Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.core.filebuffers.tests/.settings/org.eclipse.jdt.core.prefs64
-rw-r--r--org.eclipse.core.filebuffers/.classpath7
-rw-r--r--org.eclipse.core.filebuffers/.cvsignore1
-rw-r--r--org.eclipse.core.filebuffers/.project31
-rw-r--r--org.eclipse.core.filebuffers/about.html30
-rw-r--r--org.eclipse.core.filebuffers/build.properties17
-rw-r--r--org.eclipse.core.filebuffers/hglegal2003.htm14
-rw-r--r--org.eclipse.core.filebuffers/ngibmcpy2003.gifbin1101 -> 0 bytes
-rw-r--r--org.eclipse.core.filebuffers/plugin.properties16
-rw-r--r--org.eclipse.core.filebuffers/plugin.xml36
-rw-r--r--org.eclipse.core.filebuffers/schema/annotationModelCreation.exsd136
-rw-r--r--org.eclipse.core.filebuffers/schema/documentCreation.exsd143
-rw-r--r--org.eclipse.core.filebuffers/schema/documentSetup.exsd143
-rw-r--r--org.eclipse.core.filebuffers/scripts/exportplugin.xml28
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java114
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IAnnotationModelFactory.java38
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IDocumentFactory.java33
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IDocumentSetupParticipant.java41
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBuffer.java137
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBufferListener.java98
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBufferManager.java139
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IPersistableAnnotationModel.java57
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ISynchronizationContext.java40
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBuffer.java56
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBufferManager.java73
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/package.html17
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/AbstractFileBuffer.java36
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ContainerGenerator.java130
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/DefaultDocumentFactory.java32
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java557
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersMessages.java82
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersMessages.properties29
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersPlugin.java96
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaFileBuffer.java217
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java436
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java426
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java523
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java315
-rw-r--r--org.eclipse.jface.text/.classpath8
-rw-r--r--org.eclipse.jface.text/.cvsignore1
-rw-r--r--org.eclipse.jface.text/.options7
-rw-r--r--org.eclipse.jface.text/.project32
-rw-r--r--org.eclipse.jface.text/about.html30
-rw-r--r--org.eclipse.jface.text/build.properties17
-rw-r--r--org.eclipse.jface.text/plugin.properties12
-rw-r--r--org.eclipse.jface.text/plugin.xml22
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/AnnotationBag.java52
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/IProjectionListener.java29
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotation.java154
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationHover.java160
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationModel.java146
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionRulerColumn.java224
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.java285
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSupport.java260
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java1537
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java338
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/images/collapsed.gifbin82 -> 0 bytes
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/images/expanded.gifbin82 -> 0 bytes
-rw-r--r--org.eclipse.jface.text/scripts/exportplugin.xml29
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/AbstractControlContentAssistSubjectAdapter.java823
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/ComboContentAssistSubjectAdapter.java211
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/IContentAssistSubjectControl.java297
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/ISubjectControlContentAssistProcessor.java53
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/ISubjectControlContentAssistant.java31
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/ISubjectControlContextInformationPresenter.java34
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/ISubjectControlContextInformationValidator.java35
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/SubjectControlContentAssistant.java32
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/SubjectControlContextInformationValidator.java78
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/TextContentAssistSubjectAdapter.java192
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/images/content_assist_cue.gifbin106 -> 0 bytes
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/contentassist/package.html25
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/AdditionalInfoController2.java255
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/CompletionProposalPopup2.java871
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/ContentAssistMessages.java82
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/ContentAssistMessages.properties19
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/ContentAssistant2.java1587
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/ContextInformationPopup2.java629
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/HTML2TextReader.java302
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/HTMLTextPresenter.java191
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/Helper2.java32
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/IContentAssistListener2.java35
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/IProposalListener.java26
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/LineBreakingReader.java114
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/PopupCloser2.java100
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/SingleCharReader.java61
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/SubstitutionTextReader.java151
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/package.html14
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/AbstractHoverInformationControlManager.java488
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/AbstractInformationControlManager.java1011
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/CursorLinePainter.java259
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/DefaultAutoIndentStrategy.java91
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/DefaultDocumentAdapter.java410
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/DefaultInformationControl.java420
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/DefaultTextDoubleClickStrategy.java218
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/DefaultUndoManager.java835
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/DocumentClone.java72
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/DocumentCommand.java468
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IAutoEditStrategy.java33
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IAutoIndentStrategy.java21
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IDocumentAdapter.java37
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IDocumentAdapterExtension.java39
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IEventConsumer.java41
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IFindReplaceTarget.java72
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IFindReplaceTargetExtension.java89
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IFindReplaceTargetExtension3.java53
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IInformationControl.java145
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IInformationControlCreator.java33
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IInformationControlCreatorExtension.java41
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IInformationControlExtension.java29
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IInformationControlExtension2.java31
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IInformationControlExtension3.java73
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IMarkRegionTarget.java32
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IMarkSelection.java48
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IPaintPositionManager.java40
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IPainter.java94
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IRewriteTarget.java55
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ISelectionValidator.java36
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextDoubleClickStrategy.java33
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextHover.java52
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextHoverExtension.java29
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextInputListener.java40
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextListener.java39
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextOperationTarget.java101
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextOperationTargetExtension.java32
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextPresentationListener.java34
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextSelection.java84
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextViewer.java434
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextViewerExtension.java103
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextViewerExtension2.java108
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextViewerExtension3.java96
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextViewerExtension4.java50
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/ITextViewerExtension5.java118
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IUndoManager.java94
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IViewportListener.java32
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IWidgetTokenKeeper.java34
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IWidgetTokenKeeperExtension.java46
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IWidgetTokenOwner.java45
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/IWidgetTokenOwnerExtension.java37
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/JFaceTextMessages.java32
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/JFaceTextMessages.properties33
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/MarginPainter.java171
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/MarkSelection.java69
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/PaintManager.java380
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/PropagatingFontFieldEditor.java133
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextAttribute.java121
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextEvent.java120
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextPresentation.java699
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextSelection.java189
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java4858
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewerHoverManager.java417
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AdditionalInfoController.java268
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposal.java135
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java1107
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistSubjectControlAdapter.java408
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContentAssistant.java1803
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContextInformation.java96
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContextInformationPopup.java794
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ContextInformationValidator.java64
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/Helper.java32
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ICompletionProposal.java87
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ICompletionProposalExtension.java68
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ICompletionProposalExtension2.java74
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ICompletionProposalExtension3.java70
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContentAssistListener.java36
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContentAssistProcessor.java86
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContentAssistant.java91
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContentAssistantExtension.java35
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContextInformation.java63
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContextInformationExtension.java29
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContextInformationPresenter.java47
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContextInformationValidator.java44
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/JFaceTextMessages.java32
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/PopupCloser.java100
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/package.html25
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/ContentFormatter.java796
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/ContextBasedFormattingStrategy.java76
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/FormattingContext.java165
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/FormattingContextProperties.java69
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/IContentFormatter.java55
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/IContentFormatterExtension.java75
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/IFormattingContext.java156
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/IFormattingStrategy.java55
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/IFormattingStrategyExtension.java61
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/MultiPassContentFormatter.java314
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/package.html57
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/information/IInformationPresenter.java64
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/information/IInformationPresenterExtension.java27
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/information/IInformationProvider.java54
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/information/IInformationProviderExtension.java42
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/information/IInformationProviderExtension2.java31
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/information/InformationPresenter.java494
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/information/package.html22
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/link/LinkedModeUI.java1178
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/link/LinkedPositionAnnotations.java310
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/link/ProposalPosition.java88
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/link/TabStopIterator.java215
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/link/package.html71
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/package.html82
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/IPresentationDamager.java60
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/IPresentationReconciler.java76
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/IPresentationReconcilerExtension.java27
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/IPresentationRepairer.java56
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/PresentationReconciler.java583
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/presentation/package.html24
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/AbstractReconcileStep.java165
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/AbstractReconciler.java544
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/DirtyRegion.java97
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/DirtyRegionQueue.java104
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/IReconcilableModel.java21
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/IReconcileResult.java22
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/IReconcileStep.java100
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/IReconciler.java62
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/IReconcilerExtension.java27
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/IReconcilingStrategy.java60
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/IReconcilingStrategyExtension.java45
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/MonoReconciler.java107
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/Reconciler.java219
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/reconciler/package.html25
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/BufferedRuleBasedScanner.java133
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/DefaultDamagerRepairer.java218
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/DefaultPartitioner.java635
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/EndOfLineRule.java67
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/ICharacterScanner.java51
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/IPartitionTokenScanner.java42
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/IPredicateRule.java47
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/IRule.java33
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/IToken.java53
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/ITokenScanner.java58
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/IWhitespaceDetector.java28
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/IWordDetector.java38
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/MultiLineRule.java63
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/NumberRule.java72
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/PatternRule.java273
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/RuleBasedDamagerRepairer.java49
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/RuleBasedPartitionScanner.java106
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/RuleBasedPartitioner.java587
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/RuleBasedScanner.java198
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/SingleLineRule.java89
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/Token.java125
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/WhitespaceRule.java58
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/WordPatternRule.java108
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/WordRule.java145
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/rules/package.html21
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationBarHoverManager.java555
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationColumn.java30
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationPainter.java1394
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java985
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java665
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/CompositeRuler.java856
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IAnnotationAccess.java51
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IAnnotationAccessExtension.java89
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IAnnotationHover.java33
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IAnnotationHoverExtension.java65
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IAnnotationPresentation.java46
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IChangeRulerColumn.java63
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcher.java70
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ILineDiffInfo.java73
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ILineDiffer.java73
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ILineRange.java31
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRuler.java116
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ISharedTextColors.java39
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ISourceViewer.java162
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ISourceViewerExtension.java37
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ISourceViewerExtension2.java37
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IVerticalRuler.java75
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IVerticalRulerColumn.java74
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IVerticalRulerExtension.java41
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IVerticalRulerInfo.java63
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IVerticalRulerInfoExtension.java47
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/IVerticalRulerListener.java48
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ImageUtilities.java87
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/JFaceTextMessages.java68
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineChangeHover.java308
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberChangeRulerColumn.java434
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java895
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineRange.java39
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java262
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java1229
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRulerHoverManager.java77
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java902
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewerConfiguration.java309
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRuler.java588
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRulerEvent.java46
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/VisualAnnotationModel.java146
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/package.html26
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/ContextTypeRegistry.java55
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/InclusivePositionUpdater.java103
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/JFaceTextTemplateMessages.java61
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/JFaceTextTemplateMessages.properties14
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/PositionBasedCompletionProposal.java168
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/TemplateCompletionProcessor.java228
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/TemplateProposal.java408
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/package.html113
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplatePersistenceData.java173
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplatePersistenceMessages.java61
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplatePersistenceMessages.properties14
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateReaderWriter.java345
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java344
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/package.html113
-rw-r--r--org.eclipse.search.tests/.classpath7
-rw-r--r--org.eclipse.search.tests/.cvsignore1
-rw-r--r--org.eclipse.search.tests/.project32
-rw-r--r--org.eclipse.search.tests/.template4
-rw-r--r--org.eclipse.search.tests/build.properties4
-rw-r--r--org.eclipse.search.tests/plugin.xml28
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/AllSearchModelTests.java40
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/LineConversionTest.java106
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/LongQuery.java43
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullQuery.java42
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/NullSearchResult.java66
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/QueryManagerTest.java120
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/core/tests/TestSearchResult.java249
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/AllSearchTests.java29
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/SearchTestPlugin.java67
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/AllFileSearchTests.java30
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/AnnotationManagerSetup.java31
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/AnnotationManagerTest.java191
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/JUnitSetup.java40
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineAnnotationManagerTest.java110
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/LineBasedFileSearch.java38
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java128
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/ResultUpdaterTest.java69
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SearchResultPageTest.java138
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/SortingTest.java99
-rw-r--r--org.eclipse.search.tests/testresources/junit37-noUI-src.zipbin44676 -> 0 bytes
-rw-r--r--org.eclipse.search/.classpath8
-rw-r--r--org.eclipse.search/.cvsignore1
-rw-r--r--org.eclipse.search/.project39
-rw-r--r--org.eclipse.search/about.html30
-rw-r--r--org.eclipse.search/build.properties19
-rw-r--r--org.eclipse.search/buildnotes_search.html217
-rw-r--r--org.eclipse.search/hglegal2003.htm14
-rw-r--r--org.eclipse.search/icons/full/dlcl16/collapseall.gifbin155 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/expandall.gifbin164 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/flatLayout.gifbin79 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/hierarchicalLayout.gifbin85 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_goto.gifbin348 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_history.gifbin371 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_next.gifbin152 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_prev.gifbin152 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_rem.gifbin159 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_remall.gifbin187 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/search_sortmatch.gifbin154 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/stop.gifbin152 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dlcl16/tsearch_obj.gifbin368 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dtool16/group_by_file.gifbin230 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dtool16/group_by_folder.gifbin222 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dtool16/group_by_project.gifbin339 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/dtool16/search.gifbin331 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/collapseall.gifbin157 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/expandall.gifbin164 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/flatLayout.gifbin97 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/hierarchicalLayout.gifbin101 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_goto.gifbin372 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_history.gifbin598 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_next.gifbin332 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_prev.gifbin323 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_rem.gifbin163 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_remall.gifbin204 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/search_sortmatch.gifbin344 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/stop.gifbin215 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/elcl16/tsearch_obj.gifbin592 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/etool16/group_by_file.gifbin573 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/etool16/group_by_folder.gifbin347 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/etool16/group_by_project.gifbin364 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/etool16/search.gifbin347 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/eview16/searchres.gifbin347 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/obj16/searchm_obj.gifbin145 -> 0 bytes
-rw-r--r--org.eclipse.search/icons/full/obj16/tsearch_dpdn_obj.gifbin349 -> 0 bytes
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/IQueryListener.java51
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/ISearchQuery.java70
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/ISearchResult.java72
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/ISearchResultListener.java35
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/ISearchResultPage.java98
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/ISearchResultViewPart.java54
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/NewSearchUI.java210
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/SearchResultEvent.java41
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/package.html16
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchResult.java327
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java1193
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/IEditorMatchAdapter.java53
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/IFileMatchAdapter.java50
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/ISearchEditorAccess.java45
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/Match.java133
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/MatchEvent.java100
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/RemoveAllEvent.java27
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/package.html14
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/CancelSearchAction.java36
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/InternalSearchUI.java309
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/QueryManager.java151
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/RemoveAllSearchesAction.java32
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchAgainAction.java36
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchDropDownAction.java93
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchMessages.java37
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchMessages.properties67
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchPageRegistry.java129
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchView.java461
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchesDialog.java179
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/ShowSearchAction.java40
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/ShowSearchesAction.java68
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/ThrottlingProgressMonitor.java55
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/CollapseAllAction.java32
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/ExpandAllAction.java32
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/INavigate.java21
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/RemoveAllMatchesAction.java37
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/RemoveMatchAction.java39
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/RemoveSelectedMatchesAction.java32
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/SetLayoutAction.java36
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/ShowNextResultAction.java35
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/ShowPreviousResultAction.java35
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/TableViewerNavigator.java42
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/basic/views/TreeViewerNavigator.java198
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/AnnotationHighlighter.java156
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/AnnotationManagers.java62
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/EditorAccessHighlighter.java201
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/EditorAnnotationManager.java207
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/Highlighter.java67
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/MarkerHighlighter.java112
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/PositionTracker.java395
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/text/WindowAnnotationManager.java124
-rw-r--r--org.eclipse.search/ngibmcpy2003.gifbin1101 -> 0 bytes
-rw-r--r--org.eclipse.search/old_buildnotes_search_2.1.html3403
-rw-r--r--org.eclipse.search/old_buildnotes_search_2_0.html925
-rw-r--r--org.eclipse.search/plugin.properties54
-rw-r--r--org.eclipse.search/plugin.xml284
-rw-r--r--org.eclipse.search/schema/searchPages.exsd234
-rw-r--r--org.eclipse.search/schema/searchResultSorters.exsd165
-rw-r--r--org.eclipse.search/schema/searchResultViewPages.exsd131
-rw-r--r--org.eclipse.search/scripts/exportplugin.xml32
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/ISearchScope.java37
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/SearchScope.java101
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/AmountOfWorkCalculator.java71
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/FileMatchCollector.java38
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/IMatchCollector.java21
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/ITextSearchResultCollector.java44
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/MatchLocator.java184
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchEngine.java72
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchScope.java223
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java206
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TypedResourceVisitor.java67
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/CopyToClipboardAction.java90
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/GotoMarkerAction.java29
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ISearchHelpContextIds.java35
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/OpenFileSearchPageAction.java58
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/OpenSearchDialogAction.java84
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllResultsAction.java26
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveAllSearchesAction.java26
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveMatchAction.java60
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemovePotentialMatchesAction.java117
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/RemoveResultAction.java96
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ResourceToItemsMapper.java163
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ScopePart.java424
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/Search.java213
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchAgainAction.java27
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDialog.java609
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchDropDownAction.java92
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchManager.java507
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.java65
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchMessages.properties358
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPageDescriptor.java360
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPlugin.java382
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPluginImages.java113
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java336
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultContentProvider.java39
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultLabelProvider.java72
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultView.java328
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntry.java198
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewEntryAdapterFactory.java52
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java723
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SelectAllAction.java43
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowNextResultAction.java30
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowPreviousResultAction.java30
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchAction.java37
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/ShowSearchesAction.java128
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SortDropDownAction.java218
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SorterDescriptor.java106
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/WorkingSetComparator.java37
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/EditorOpener.java110
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileContentProvider.java33
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileLabelProvider.java125
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileMatch.java32
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileSearchDescription.java35
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileSearchPage.java243
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileSearchQuery.java175
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileSearchResult.java92
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileTableContentProvider.java66
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/FileTreeContentProvider.java155
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/GotoMarkerAction.java145
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/GroupByKeyComputer.java25
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/NameSorter.java32
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/NewTextSearchActionGroup.java108
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/PathSorter.java28
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/RegExContentAssistProcessor.java343
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceAction.java207
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceAction2.java277
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceDialog.java679
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ReplaceDialog2.java750
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcePathSorter.java66
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/ResourcenameSorter.java66
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/SearchAgainConfirmationDialog.java118
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/SearchResultUpdater.java85
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/SortAction.java33
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchActionGroup.java159
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchOperation.java102
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchPage.java838
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/TextSearchResultCollector.java139
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ComboFieldEditor.java186
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExceptionHandler.java141
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java361
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileLabelProvider.java132
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/FileTypeEditor.java109
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListContentProvider.java47
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/ListDialog.java125
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/MessageLine.java144
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/PixelConverter.java58
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/RowLayouter.java172
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/SWTUtil.java122
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/util/TypeFilteringDialog.java291
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IActionGroupFactory.java41
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IContextMenuConstants.java114
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IContextMenuContributor.java36
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IGroupByKeyComputer.java30
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/IReplacePage.java31
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchPage.java47
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchPageContainer.java121
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchPageScoreComputer.java50
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchResultView.java185
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/ISearchResultViewEntry.java68
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/SearchUI.java196
-rw-r--r--org.eclipse.search/search/org/eclipse/search/ui/package.html25
-rw-r--r--org.eclipse.text.tests/src/org/eclipse/text/tests/Accessor.java284
-rw-r--r--org.eclipse.text/.classpath8
-rw-r--r--org.eclipse.text/.cvsignore1
-rw-r--r--org.eclipse.text/.project28
-rw-r--r--org.eclipse.text/about.html30
-rw-r--r--org.eclipse.text/build.properties16
-rw-r--r--org.eclipse.text/plugin.properties12
-rw-r--r--org.eclipse.text/plugin.xml15
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ChildDocument.java97
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ChildDocumentManager.java34
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/Fragment.java41
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/FragmentUpdater.java136
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/IMinimalMapping.java52
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java889
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentEvent.java137
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentManager.java223
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionMapping.java626
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionTextStore.java158
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/Segment.java81
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/SegmentUpdater.java128
-rw-r--r--org.eclipse.text/projection/org/eclipse/jface/text/projection/package.html23
-rw-r--r--org.eclipse.text/scripts/exportplugin.xml29
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java1309
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java554
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/Assert.java180
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/BadLocationException.java36
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/BadPartitioningException.java36
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/BadPositionCategoryException.java38
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java65
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java80
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/DefaultPositionUpdater.java238
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/Document.java78
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/DocumentEvent.java95
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/DocumentPartitioningChangedEvent.java120
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java317
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java258
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocument.java637
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentExtension.java88
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentExtension2.java54
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentExtension3.java156
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentInformationMapping.java121
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentInformationMappingExtension.java79
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentListener.java41
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitioner.java152
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitionerExtension.java44
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitionerExtension2.java119
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitioningListener.java54
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitioningListenerExtension.java39
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IDocumentPartitioningListenerExtension2.java38
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java136
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IPositionUpdater.java40
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IRegion.java40
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/IRepairableDocument.java27
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ISlaveDocumentManager.java103
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ISlaveDocumentManagerExtension.java31
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ISynchronizable.java47
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ITextStore.java65
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ITypedRegion.java32
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/Line.java68
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/Position.java194
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/Region.java66
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java273
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/SlaveDocumentEvent.java45
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java529
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/TypedPosition.java79
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/TypedRegion.java61
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/link/ILinkedModeListener.java73
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/link/InclusivePositionUpdater.java107
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeManager.java232
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeModel.java760
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPosition.java177
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPositionGroup.java353
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/link/package.html55
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/package.html30
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/source/Annotation.java158
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationMap.java187
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java767
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModelEvent.java259
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationMap.java75
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationModel.java135
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationModelExtension.java105
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationModelListener.java38
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationModelListenerExtension.java30
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/source/package.html16
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/DocumentTemplateContext.java154
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/GlobalTemplateVariables.java176
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/SimpleTemplateVariableResolver.java60
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/Template.java176
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateBuffer.java74
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateContext.java118
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateContextType.java296
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateException.java59
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateTranslator.java260
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateVariable.java201
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateVariableResolver.java172
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/TextTemplateMessages.java61
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/TextTemplateMessages.properties24
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/templates/package.html113
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/CopySourceEdit.java309
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/CopyTargetEdit.java161
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/CopyingRangeMarker.java78
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/DeleteEdit.java75
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java209
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/ISourceModifier.java49
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/InsertEdit.java96
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/MalformedTreeException.java62
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/Messages.properties33
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/MoveSourceEdit.java419
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/MoveTargetEdit.java192
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java150
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/RangeMarker.java72
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/ReplaceEdit.java99
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/TextEdit.java849
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/TextEditCopier.java99
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/TextEditGroup.java137
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/TextEditMessages.java41
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/TextEditProcessor.java206
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/TextEditVisitor.java225
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/TreeIterationInfo.java59
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/UndoCollector.java65
-rw-r--r--org.eclipse.text/src/org/eclipse/text/edits/UndoEdit.java105
-rw-r--r--org.eclipse.ui.editors.tests/.classpath2
-rw-r--r--org.eclipse.ui.editors.tests/.settings/org.eclipse.jdt.core.prefs64
-rw-r--r--org.eclipse.ui.editors.tests/build.properties6
-rw-r--r--org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/EditorsTestSuite.java28
-rw-r--r--org.eclipse.ui.editors.tests/test.xml4
-rw-r--r--org.eclipse.ui.editors/.classpath7
-rw-r--r--org.eclipse.ui.editors/.cvsignore1
-rw-r--r--org.eclipse.ui.editors/.project35
-rw-r--r--org.eclipse.ui.editors/_buildnotes_text_2_0.html971
-rw-r--r--org.eclipse.ui.editors/_buildnotes_text_2_1.html267
-rw-r--r--org.eclipse.ui.editors/about.html30
-rw-r--r--org.eclipse.ui.editors/build.properties18
-rw-r--r--org.eclipse.ui.editors/buildnotes_text.html707
-rw-r--r--org.eclipse.ui.editors/icons/full/ctool16/last_edit_pos.gifbin224 -> 0 bytes
-rw-r--r--org.eclipse.ui.editors/icons/full/ctool16/next_nav.gifbin375 -> 0 bytes
-rw-r--r--org.eclipse.ui.editors/icons/full/ctool16/prev_nav.gifbin370 -> 0 bytes
-rw-r--r--org.eclipse.ui.editors/icons/full/dtool16/last_edit_pos.gifbin207 -> 0 bytes
-rw-r--r--org.eclipse.ui.editors/icons/full/dtool16/next_nav.gifbin244 -> 0 bytes
-rw-r--r--org.eclipse.ui.editors/icons/full/dtool16/prev_nav.gifbin246 -> 0 bytes
-rw-r--r--org.eclipse.ui.editors/icons/full/etool16/last_edit_pos.gifbin223 -> 0 bytes
-rw-r--r--org.eclipse.ui.editors/icons/full/etool16/next_nav.gifbin375 -> 0 bytes
-rw-r--r--org.eclipse.ui.editors/icons/full/etool16/prev_nav.gifbin370 -> 0 bytes
-rw-r--r--org.eclipse.ui.editors/icons/full/obj16/file_obj.gifbin354 -> 0 bytes
-rw-r--r--org.eclipse.ui.editors/migration_guidelines.html57
-rw-r--r--org.eclipse.ui.editors/plugin.properties91
-rw-r--r--org.eclipse.ui.editors/plugin.xml662
-rw-r--r--org.eclipse.ui.editors/schema/annotationTypes.exsd130
-rw-r--r--org.eclipse.ui.editors/schema/documentProviders.exsd147
-rw-r--r--org.eclipse.ui.editors/schema/markerAnnotationSpecification.exsd334
-rw-r--r--org.eclipse.ui.editors/schema/markerUpdaters.exsd142
-rw-r--r--org.eclipse.ui.editors/schema/templates.exsd317
-rw-r--r--org.eclipse.ui.editors/scripts/exportplugin.xml31
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/DefaultEncodingSupport.java226
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EditorsUI.java141
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EncodingActionGroup.java463
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java1053
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ForwardingDocumentProvider.java365
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsConstants.java77
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsDefinitionIds.java76
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsHelpContextIds.java79
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingSupport.java41
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IFoldingCommandIds.java49
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ILocationProvider.java35
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IStorageDocumentProvider.java46
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ITextEditorHelpContextIds.java49
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/StorageDocumentProvider.java437
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java321
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorActionContributor.java126
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java71
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.properties129
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferenceConstants.java260
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferencePage.java119
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java1119
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java78
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/package.html12
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java195
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.java42
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.properties14
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java230
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/package.html113
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/LastSaveReferenceProvider.java436
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffMessages.java44
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffMessages.properties14
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AbstractConfigurationBlockPreferencePage.java125
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsConfigurationBlock.java433
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsPreferencePage.java54
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ColorEditor.java159
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java171
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/FileEditorInputAdapterFactory.java62
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IEditorsStatusConstants.java28
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IPreferenceConfigurationBlock.java64
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/JavaFileEditorInput.java112
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPreviousPulldownActionDelegate.java192
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPulldownActionDelegate.java29
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OpenExternalFileAction.java162
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OverlayPreferenceStore.java547
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PixelConverter.java62
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PreviousPulldownActionDelegate.java30
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java406
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffPreferencePage.java54
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SharedTextColors.java76
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/StatusInfo.java194
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TabFolderLayout.java66
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java52
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties67
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorPreferencePage2.java550
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UISynchronizationContext.java42
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/WorkspaceOperationRunner.java75
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationType.java70
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationTypeHierarchy.java109
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/DelegatingAnnotationPreference.java251
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java367
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/TextChangeHover.java63
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java1078
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java306
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractMarkerAnnotationModel.java645
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AddMarkerAction.java327
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AddTaskAction.java61
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationPreferenceLookup.java116
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AnnotationTypeLookup.java208
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/BasicMarkerUpdater.java96
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/BookmarkRulerAction.java31
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ChainedPreferenceStore.java555
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DefaultMarkerAnnotationAccess.java364
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/DocumentProviderRegistry.java322
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/IMarkerUpdater.java58
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ImageUtilities.java38
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotation.java311
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerAnnotationPreferences.java495
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerAction.java458
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerRulerInfoAction.java29
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerUpdater.java64
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/MarkerUtilities.java410
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ResourceMarkerAnnotationModel.java147
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ResourceMarkerAnnotationModelFactory.java35
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SelectMarkerRulerAction.java320
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SelectMarkerRulerInfoAction.java30
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SelectRulerAction.java30
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/SimpleMarkerAnnotation.java108
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TaskRulerAction.java77
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TextEditorMessages.java51
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/TextEditorMessages.properties71
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/package.html10
-rw-r--r--org.eclipse.ui.examples.javaeditor/.classpath8
-rw-r--r--org.eclipse.ui.examples.javaeditor/.cvsignore1
-rw-r--r--org.eclipse.ui.examples.javaeditor/.project35
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaActionContributor.java90
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaAnnotationHover.java38
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java237
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaDocumentSetupParticipant.java41
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java255
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorExamplePlugin.java99
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.java36
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditorMessages.properties44
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java105
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaSourceViewerConfiguration.java166
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaTextHover.java45
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/PresentationAction.java52
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java263
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java69
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCompletionProcessor.java111
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaDoubleClickSelector.java240
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaEditorMessages.java32
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocCompletionProcessor.java68
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java80
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/togglepresentation.gifbin125 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java58
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWhitespaceDetector.java27
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaWordDetector.java34
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/ColorManager.java38
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/IXMLColorConstants.java21
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/NonRuleBasedDamagerRepairer.java148
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TagRule.java41
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditor.java57
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateEditorUI.java108
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateMessages.java65
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/TemplateMessages.properties13
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLConfiguration.java101
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLDocumentProvider.java35
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLDoubleClickStrategy.java122
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLPartitionScanner.java32
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLScanner.java32
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLTagScanner.java34
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/editors/XMLWhitespaceDetector.java20
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/preferences/TemplatesPreferencePage.java40
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/AntVariableResolver.java50
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/XMLCompletionProcessor.java99
-rw-r--r--org.eclipse.ui.examples.javaeditor/Template Editor Example/org/eclipse/ui/examples/templateeditor/template/XMLContextType.java43
-rw-r--r--org.eclipse.ui.examples.javaeditor/about.html30
-rw-r--r--org.eclipse.ui.examples.javaeditor/build.properties23
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/hglegal.htm14
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/hglegal2002.htm13
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/hglegal2003.htm14
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy.gifbin814 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2002.gifbin1045 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ngibmcpy2003.gifbin1101 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ui_javaeditor_ex.html237
-rw-r--r--org.eclipse.ui.examples.javaeditor/doc-html/ui_templateeditor_ex.html69
-rw-r--r--org.eclipse.ui.examples.javaeditor/icons/obj16/java.gifbin140 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/icons/resolver.gifbin983 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/icons/sample.gifbin983 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/icons/template.gifbin155 -> 0 bytes
-rw-r--r--org.eclipse.ui.examples.javaeditor/plugin.properties38
-rw-r--r--org.eclipse.ui.examples.javaeditor/plugin.xml119
-rw-r--r--org.eclipse.ui.examples.javaeditor/templates/ant.properties12
-rw-r--r--org.eclipse.ui.examples.javaeditor/templates/ant.xml14
-rw-r--r--org.eclipse.ui.workbench.texteditor.tests/.classpath2
-rw-r--r--org.eclipse.ui.workbench.texteditor.tests/.settings/org.eclipse.jdt.core.prefs64
-rw-r--r--org.eclipse.ui.workbench.texteditor.tests/build.properties7
-rw-r--r--org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/WorkbenchTextEditorTestSuite.java28
-rw-r--r--org.eclipse.ui.workbench.texteditor.tests/test.xml4
-rw-r--r--org.eclipse.ui.workbench.texteditor/.classpath7
-rw-r--r--org.eclipse.ui.workbench.texteditor/.cvsignore1
-rw-r--r--org.eclipse.ui.workbench.texteditor/.project31
-rw-r--r--org.eclipse.ui.workbench.texteditor/about.html30
-rw-r--r--org.eclipse.ui.workbench.texteditor/build.properties18
-rw-r--r--org.eclipse.ui.workbench.texteditor/icons/full/ctool16/segment_edit.gifbin590 -> 0 bytes
-rw-r--r--org.eclipse.ui.workbench.texteditor/icons/full/dtool16/segment_edit.gifbin241 -> 0 bytes
-rw-r--r--org.eclipse.ui.workbench.texteditor/icons/full/etool16/segment_edit.gifbin590 -> 0 bytes
-rw-r--r--org.eclipse.ui.workbench.texteditor/plugin.properties158
-rw-r--r--org.eclipse.ui.workbench.texteditor/plugin.xml1079
-rw-r--r--org.eclipse.ui.workbench.texteditor/schema/quickDiffReferenceProvider.exsd149
-rw-r--r--org.eclipse.ui.workbench.texteditor/scripts/exportplugin.xml32
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/contentassist/ContentAssistHandler.java238
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/contentassist/ContentAssistMessages.java82
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/contentassist/ContentAssistMessages.properties14
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/AnnotationExpandHover.java305
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/AnnotationExpansionControl.java795
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/EditPosition.java87
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/EditorMessages.java35
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/EditorMessages.properties16
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/GotoLastEditPositionAction.java176
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/LinearLayouter.java58
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/TextEditorPlugin.java180
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/DiffRegion.java205
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/DocumentLineDiffer.java1405
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/QuickDiffExtensionsRegistry.java93
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/QuickDiffMessages.java52
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/QuickDiffMessages.properties35
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/QuickDiffRestoreAction.java161
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/ReferenceSelectionAction.java170
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/RestoreAction.java100
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/RevertBlockAction.java91
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/RevertLineAction.java89
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/RevertSelectionAction.java102
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/DifferencesIterator.java79
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/DocLineComparator.java349
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/IRangeComparator.java62
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/ITokenComparator.java57
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/LinkedRangeDifference.java60
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/LinkedRangeFactory.java110
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/RangeDifference.java289
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/RangeDifferencer.java555
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/compare/rangedifferencer/package.html12
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/quickdiff/package.html13
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java1028
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractRulerActionDelegate.java147
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java5129
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java1058
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/BasicTextEditorActionContributor.java273
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/CaseAction.java112
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConfigurationElementSorter.java167
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ContentAssistAction.java122
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java273
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DefaultRangeIndicator.java175
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DeleteLineAction.java179
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DeleteLineTarget.java353
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/EditorMessages.java36
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/EditorMessages.properties426
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/EditorStatusLine.java140
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindNextAction.java398
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceAction.java250
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceDialog.java1814
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceTarget.java222
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/GotoLineAction.java188
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IAbstractTextEditorHelpContextIds.java301
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IAnnotationImageProvider.java55
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProvider.java220
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProviderExtension.java115
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProviderExtension2.java38
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProviderExtension3.java29
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IEditorStatusLine.java35
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IElementStateListener.java77
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IElementStateListenerExtension.java47
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IFindReplaceTargetExtension2.java29
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IReadOnlyDependent.java37
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ISchedulingRuleProvider.java30
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IStatusField.java50
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IStatusFieldExtension.java65
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditor.java198
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorActionConstants.java418
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorActionDefinitionIds.java450
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorDropTargetListener.java32
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension.java65
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension2.java47
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension3.java72
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IUpdate.java24
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IWorkbenchActionDefinitionIds.java147
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindAction.java119
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindTarget.java786
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java229
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InsertLineAction.java177
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkAction.java79
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MarkRegionTarget.java125
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/MoveLinesAction.java504
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/PropagatingFontFieldEditor.java29
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RegExContentAssistProcessor.java356
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ResourceAction.java149
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RetargetTextEditorAction.java239
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RevertToSavedAction.java56
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SaveAction.java56
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SelectAnnotationRulerAction.java102
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ShiftAction.java161
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java981
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/StatusLineContributionItem.java288
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/StatusTextEditor.java197
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextEditorAction.java151
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextNavigationAction.java302
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextOperationAction.java156
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextSelectionNavigationLocation.java343
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ValidateStateException.java32
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/WorkbenchChainedTextFontFieldEditor.java70
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/link/EditorLinkedModeUI.java97
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/package.html30
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/IQuickDiffReferenceProvider.java78
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/QuickDiff.java143
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/QuickDiffToggleAction.java211
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/ReferenceProviderDescriptor.java132
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/quickdiff/package.html13
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/EditTemplateDialog.java547
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/MessageLine.java82
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/StatusDialog.java180
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/StatusInfo.java184
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateContentProvider.java51
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java820
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProcessor.java160
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProposal.java109
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TextEditorTemplateMessages.java61
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TextEditorTemplateMessages.properties88
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/package.html113
971 files changed, 489 insertions, 162584 deletions
diff --git a/org.eclipse.core.filebuffers.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.core.filebuffers.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..8901c09cd
--- /dev/null
+++ b/org.eclipse.core.filebuffers.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,64 @@
+#Fri Aug 27 09:16:12 CEST 2004
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
+org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.incompatibleJDKLevel=ignore
+eclipse.preferences.version=1
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private
+org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.incompleteClasspath=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.builder.duplicateResourceTask=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
diff --git a/org.eclipse.core.filebuffers/.classpath b/org.eclipse.core.filebuffers/.classpath
deleted file mode 100644
index 065ac06e1..000000000
--- a/org.eclipse.core.filebuffers/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.core.filebuffers/.cvsignore b/org.eclipse.core.filebuffers/.cvsignore
deleted file mode 100644
index c5e82d745..000000000
--- a/org.eclipse.core.filebuffers/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/org.eclipse.core.filebuffers/.project b/org.eclipse.core.filebuffers/.project
deleted file mode 100644
index ac71d98c0..000000000
--- a/org.eclipse.core.filebuffers/.project
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.core.filebuffers</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime.compatibility</project>
- <project>org.eclipse.text</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.core.filebuffers/about.html b/org.eclipse.core.filebuffers/about.html
deleted file mode 100644
index 9db411aab..000000000
--- a/org.eclipse.core.filebuffers/about.html
+++ /dev/null
@@ -1,30 +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>20th June, 2002</p>
-<h3>License</h3>
-<p>Eclipse.org 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
-Common Public License Version 1.0 (&quot;CPL&quot;). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL (&quot;Other License&quot;), any modifications, enhancements and/or
-other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/org.eclipse.core.filebuffers/build.properties b/org.eclipse.core.filebuffers/build.properties
deleted file mode 100644
index a1cc6f2a0..000000000
--- a/org.eclipse.core.filebuffers/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = plugin.properties,\
- plugin.xml,\
- *.jar,\
- about.html
-src.includes = about.html,\
- schema/
-source.filebuffers.jar = src/
diff --git a/org.eclipse.core.filebuffers/hglegal2003.htm b/org.eclipse.core.filebuffers/hglegal2003.htm
deleted file mode 100644
index 47c8540c8..000000000
--- a/org.eclipse.core.filebuffers/hglegal2003.htm
+++ /dev/null
@@ -1,14 +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>
-(c) Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.
-</body>
-</html>
diff --git a/org.eclipse.core.filebuffers/ngibmcpy2003.gif b/org.eclipse.core.filebuffers/ngibmcpy2003.gif
deleted file mode 100644
index c786e43e1..000000000
--- a/org.eclipse.core.filebuffers/ngibmcpy2003.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.core.filebuffers/plugin.properties b/org.eclipse.core.filebuffers/plugin.properties
deleted file mode 100644
index 69a845b81..000000000
--- a/org.eclipse.core.filebuffers/plugin.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-pluginName= File Buffers
-providerName= Eclipse.org
-documentCreationPoint= Document Creation
-documentSetupPoint= Document Setup
-annotationModelCreationPoint= Annotation Model Creation
-defaultDocumentFactory= Default Document Factory
diff --git a/org.eclipse.core.filebuffers/plugin.xml b/org.eclipse.core.filebuffers/plugin.xml
deleted file mode 100644
index e7677fa05..000000000
--- a/org.eclipse.core.filebuffers/plugin.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.core.filebuffers"
- name="%pluginName"
- version="3.0.0"
- provider-name="%providerName"
- class="org.eclipse.core.internal.filebuffers.FileBuffersPlugin">
-
- <runtime>
- <library name="filebuffers.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.text"/>
- </requires>
-
-
- <extension-point id="documentCreation" name="%documentCreationPoint" schema="schema/documentCreation.exsd"/>
- <extension-point id="documentSetup" name="%documentSetupPoint" schema="schema/documentSetup.exsd"/>
- <extension-point id="annotationModelCreation" name="%annotationModelCreationPoint" schema="schema/annotationModelCreation.exsd"/>
-
- <extension
- id="DefaultDocumentFactory"
- name="%defaultDocumentFactory"
- point="org.eclipse.core.filebuffers.documentCreation">
- <factory
- extensions="*"
- class="org.eclipse.core.internal.filebuffers.DefaultDocumentFactory">
- </factory>
- </extension>
-
-</plugin>
diff --git a/org.eclipse.core.filebuffers/schema/annotationModelCreation.exsd b/org.eclipse.core.filebuffers/schema/annotationModelCreation.exsd
deleted file mode 100644
index aae20f474..000000000
--- a/org.eclipse.core.filebuffers/schema/annotationModelCreation.exsd
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.core.filebuffers">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.core.filebuffers" id="annotationModelCreation" name="Annotation Model Creation"/>
- </appInfo>
- <documentation>
- This extension point is used to customize the annotation model creation behavior of this plug-in&apos;s default text file buffer manager. It allows to specify which annotation model factory should be used in order to create the annotation model instance of a text file buffer created for a certain file content type, file extension, or file name.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="factory"/>
- </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>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="factory">
- <annotation>
- <documentation>
- The specification of a annotation model factory. In order to find a factory for a given file the attributes of each factory specification are consulted in the following sequence: contentTypeId, fileNames, extensions. If multiple, equally specific factory specifications are found for a given file it is not specified which factory is used.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The fully qualified name of the factory implementation class. This class must implement the org.eclipse.core.filebuffers.IAnnotationModelFactory interface.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.core.filebuffers.IAnnotationModelFactory"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="extensions" type="string">
- <annotation>
- <documentation>
- A comma separated list of file extensions for which this factory should be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="fileNames" type="string">
- <annotation>
- <documentation>
- A comma separated list of file names for which this factory should be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="contentTypeId" type="string">
- <annotation>
- <documentation>
- The id of a content type as defined by the org.eclipse.core.runtime.contentTypes extension point for which this factory should be used.
- </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>
- &lt;pre&gt;
- &lt;extension
- point=&quot;org.eclipse.core.filebuffers.annotationModelCreation&quot;&gt;
- &lt;factory
- extensions=&quot;xzy&quot;
- class=&quot;org.eclipse.ui.texteditor.ResourceMarkerAnnotationModelFactory&quot;&gt;
- &lt;/factory&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Annotation model factories have to implement org.eclipse.core.filebuffers.IAnnotationModelFactory.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.core.filebuffers/schema/documentCreation.exsd b/org.eclipse.core.filebuffers/schema/documentCreation.exsd
deleted file mode 100644
index 2bdca3617..000000000
--- a/org.eclipse.core.filebuffers/schema/documentCreation.exsd
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.core.filebuffers">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.core.filebuffers" id="documentCreation" name="Document Creation"/>
- </appInfo>
- <documentation>
- This extension point is used to customize the document creation behavior of this plug-in&apos;s default text file buffer manager. It allows to specify which document factory should be used in order to create the document instance of a text file buffer created for a certain file content type, file extension, or file name.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="factory"/>
- </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>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="factory">
- <annotation>
- <documentation>
- The specification of a document factory. In order to find a factory for a given file the attributes of each factory specification are consulted in the following sequence: contentTypeId, fileNames, extensions. If multiple, equally specific factory specifications are found for a given file it is not specified which factory is used.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The fully qualified name of the factory implementation class. This class must implement the org.eclipse.core.filebuffers.IDocumentFactory interface.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.core.filebuffers.IDocumentFactory"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="extensions" type="string">
- <annotation>
- <documentation>
- A comma separated list of file extensions for which this factory should be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="fileNames" type="string">
- <annotation>
- <documentation>
- A comma separated list of file names for which this factory should be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="contentTypeId" type="string">
- <annotation>
- <documentation>
- The id of a content type as defined by the org.eclipse.core.runtime.contentTypes extension point for which this factory should be used.
- </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;pre&gt;
-&lt;extension
- id=&quot;org.eclipse.jdt.debug.ui.SnippetDocumentFactory&quot;
- name=&quot;%snippetDocumentFactory.name&quot;
- point=&quot;org.eclipse.core.filebuffers.documentCreation&quot;&gt;
- &lt;factory
- extensions=&quot;jpage&quot;
- class=&quot;org.eclipse.jdt.internal.debug.ui.snippeteditor.SnippetDocumentFactory&quot;&gt;
- &lt;/factory&gt;
-&lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Document factories have to implement org.eclipse.core.filebuffers.IDocumentFactory.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- &lt;p&gt;
-&lt;a href=&quot;hglegal.htm&quot;&gt;
- &lt;img SRC=&quot;ngibmcpy.gif&quot;
- ALT=&quot;Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.&quot;
- BORDER=&quot;0&quot; height=&quot;14&quot; width=&quot;324&quot;&gt;&lt;/a&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.core.filebuffers/schema/documentSetup.exsd b/org.eclipse.core.filebuffers/schema/documentSetup.exsd
deleted file mode 100644
index c15fc1b2e..000000000
--- a/org.eclipse.core.filebuffers/schema/documentSetup.exsd
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.core.filebuffers">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.core.filebuffers" id="documentSetup" name="Document Setup"/>
- </appInfo>
- <documentation>
- This extension point is used to customize the initialization process of a document for a text file buffer manager by this plug-in&apos;s default text file buffer manager. It allows to specify which document setup participant should be involved in the initialization process for a text file buffer created for a certain file content type, file extension, or file name.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="participant"/>
- </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>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="participant">
- <annotation>
- <documentation>
- The specification of a document setup participant. In order find all participants for a given file the attributes of each participant specification are consulted in the following sequence: contentTypeId, fileNames, extensions. If multiple participants are found, the sequence in which they are called is not specified.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The fully qualified name of the participant implementation class. This class must implement the org.eclipse.core.filebuffers.IDocumentSetupParticipant interface.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn="org.eclipse.core.filebuffers.IDocumentSetupParticipant"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="extensions" type="string">
- <annotation>
- <documentation>
- A comma separated list of file extensions for which this participant should be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="fileNames" type="string">
- <annotation>
- <documentation>
- A comma separated list of file names for which this participant should be used.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="contentTypeId" type="string">
- <annotation>
- <documentation>
- The id of a content type as defined by the org.eclipse.core.runtime.contentTypes extension point for which this participant should be used.
- </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;pre&gt;
- &lt;extension
- id=&quot;JavaDocumentSetupParticipant&quot;
- name=&quot;%javaDocumentSetupParticipant&quot;
- point=&quot;org.eclipse.core.filebuffers.documentSetup&quot;&gt;
- &lt;participant
- extensions=&quot;java&quot;
- class=&quot;org.eclipse.jdt.internal.ui.javaeditor.JavaDocumentSetupParticipant&quot;&gt;
- &lt;/participant&gt;
- &lt;/extension&gt;
-&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Document setup participants have to implement org.eclipse.core.filebuffers.IDocumentSetupParticipant.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- &lt;p&gt;
-&lt;a href=&quot;hglegal.htm&quot;&gt;
- &lt;img SRC=&quot;ngibmcpy.gif&quot;
- ALT=&quot;Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved.&quot;
- BORDER=&quot;0&quot; height=&quot;14&quot; width=&quot;324&quot;&gt;&lt;/a&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.core.filebuffers/scripts/exportplugin.xml b/org.eclipse.core.filebuffers/scripts/exportplugin.xml
deleted file mode 100644
index 57d44f387..000000000
--- a/org.eclipse.core.filebuffers/scripts/exportplugin.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<project name="Export Text" default="export" basedir="..">
- <target name="init">
- <tstamp/>
- <property name="destdir" value="../../plugin-export" />
- <property name="plugin" value="org.eclipse.core.filebuffers" />
- <property name="version" value="_3.0.0" />
- <property name="dest" value="${destdir}/${plugin}${version}" />
- </target>
-
- <target name="build" depends="init">
- <eclipse.incrementalBuild project="${plugin}" kind="incr"/>
- </target>
-
- <target name="export" depends="build">
- <mkdir dir="${destdir}" />
- <delete dir="${dest}" />
- <mkdir dir="${dest}" />
- <jar
- jarfile="${dest}/filebuffers.jar"
- basedir="bin"
- />
- <copy file="plugin.xml" todir="${dest}"/>
- <copy file="plugin.properties" todir="${dest}"/>
- <zip zipfile="${dest}/filebufferssrc.zip">
- <fileset dir="src" />
- </zip>
- </target>
-</project>
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java
deleted file mode 100644
index 9c8ad357f..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/FileBuffers.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-
-import java.io.File;
-
-import org.eclipse.core.internal.filebuffers.FileBuffersPlugin;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-
-
-/**
- * Facade for the file buffers plug-in. Provides access to the text file buffer
- * manager and helper methods for location handling. This facade is available
- * independent from the activation status of the file buffers plug-in.
- *
- * @since 3.0
- */
-public final class FileBuffers {
-
- /**
- * Cannot be instantiated.
- */
- private FileBuffers() {
- }
-
- /**
- * Returns the text file buffer manager. May return <code>null</code> if
- * the file buffers plug-in may no be activated. This is, for example, the
- * case when the method is called on plug-in shutdown.
- *
- * @return the text file buffer manager or <code>null</code>
- */
- public static ITextFileBufferManager getTextFileBufferManager() {
- FileBuffersPlugin plugin= FileBuffersPlugin.getDefault();
- return plugin != null ? plugin.getFileBufferManager() : null;
- }
-
- /**
- * Returns the workspace file at the given location or <code>null</code> if
- * the location is not a valid location in the workspace.
- *
- * @param location the location
- * @return the workspace file at the location or <code>null</code>
- */
- public static IFile getWorkspaceFileAtLocation(IPath location) {
- IPath normalized= normalizeLocation(location);
- if (normalized.segmentCount() >= 2) {
- // @see IContainer#getFile for the required number of segments
- IWorkspaceRoot workspaceRoot= ResourcesPlugin.getWorkspace().getRoot();
- IFile file= workspaceRoot.getFile(normalized);
- if (file != null && file.exists())
- return file;
- }
- return null;
- }
-
- /**
- * Returns a copy of the given location in a normalized form.
- *
- * @param location the location to be normalized
- * @return normalized copy of location
- */
- public static IPath normalizeLocation(IPath location) {
- IWorkspaceRoot workspaceRoot= ResourcesPlugin.getWorkspace().getRoot();
- IProject[] projects= workspaceRoot.getProjects();
-
- for (int i= 0, length= projects.length; i < length; i++) {
- IPath path= projects[i].getLocation();
- if (path != null && path.isPrefixOf(location)) {
- IPath filePath= location.removeFirstSegments(path.segmentCount());
- filePath= projects[i].getFullPath().append(filePath);
- return filePath.makeAbsolute();
- }
-
- }
- return location.makeAbsolute();
- }
-
- /**
- * Returns the file in the local file system for the given location.
- * <p>
- * The location is either a full path of a workspace resource or an
- * absolute path in the local file system.
- * </p>
- *
- * @param location the location
- * @return the {@link File} in the local file system for the given location
- */
- public static File getSystemFileAtLocation(IPath location) {
- if (location == null)
- return null;
-
- IFile file= getWorkspaceFileAtLocation(location);
- if (file != null) {
- IPath path= file.getLocation();
- return path.toFile();
- }
-
- return location.toFile();
- }
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IAnnotationModelFactory.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IAnnotationModelFactory.java
deleted file mode 100644
index b21f02413..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IAnnotationModelFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-
-import org.eclipse.core.runtime.IPath;
-
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-
-/**
- * Factory for text file buffer annotation models. Used by the text file buffer
- * manager to create the annotation model for a new text file buffer.
- * <p>
- * This interface is the expected interface for extensions provided for the
- * <code>"org.eclipse.core.filebuffers.annotationModelCreation"</code>
- * extension point.
- *
- * @since 3.0
- */
-public interface IAnnotationModelFactory {
-
- /**
- * Creates and returns a new annotation model.
- *
- * @param location the normalized location
- * @return a new annotation model
- */
- IAnnotationModel createAnnotationModel(IPath location);
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IDocumentFactory.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IDocumentFactory.java
deleted file mode 100644
index 3631487e8..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IDocumentFactory.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-import org.eclipse.jface.text.IDocument;
-
-/**
- * Factory for text file buffer documents. Used by the text file buffer manager
- * to create the document for a new text file buffer.
- * <p>
- * This interface is the expected interface of extensions provided for the
- * <code>"org.eclipse.core.filebuffers.documentCreation"</code> extension
- * point.
- *
- * @since 3.0
- */
-public interface IDocumentFactory {
-
- /**
- * Creates and returns a new, empty document.
- *
- * @return a new, empty document
- */
- IDocument createDocument();
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IDocumentSetupParticipant.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IDocumentSetupParticipant.java
deleted file mode 100644
index efc408954..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IDocumentSetupParticipant.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-
-import org.eclipse.jface.text.IDocument;
-
-
-/**
- * Participates in the setup of a text file buffer document.
- * <p>
- * This interface is the expected interface for extensions provided for the
- * <code>"org.eclipse.core.filebuffers.documentSetup"</code> extension point.
- * <p>
- * Participants have to be aware of the existence of other participants. I.e.
- * they should always setup a document in a way that does not interfere with
- * others. E.g., when a participant wants to install partitioning on the
- * document, it should use the
- * {@link org.eclipse.jface.text.IDocumentExtension3}API and choose a unique
- * partitioning id.
- *
- * @since 3.0
- * @see org.eclipse.jface.text.IDocumentExtension3
- */
-public interface IDocumentSetupParticipant {
-
- /**
- * Sets up the document to be ready for use by a text file buffer.
- *
- * @param document the document to be set up
- */
- void setup(IDocument document);
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBuffer.java
deleted file mode 100644
index b483d0d5e..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBuffer.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-
-
-/**
- * A file buffer represents a file that can be edited by more than one client.
- * Editing is session oriented. This means that editing is a sequence of
- * modification steps. The start of the sequence and the end of the sequence are
- * explicitly indicated. There are no time constraints connected with the
- * sequence of modification steps. A file buffer reifies editing sessions and
- * allows them to interleave.
- * <p>
- * It is not specified whether simultaneous editing sessions can be owned by
- * different threads.
- * <p>
- * Clients are not supposed to implement that interface. Instances of this type
- * are obtained from a {@link org.eclipse.core.filebuffers.IFileBufferManager}.
- *
- * @since 3.0
- */
-public interface IFileBuffer {
-
- /**
- * Returns the location of this file buffer.
- * <p>
- * The location is either a full path of a workspace resource or an
- * absolute path in the local file system.
- * </p>
- *
- * @return the location of this file buffer
- */
- IPath getLocation();
-
- /**
- * Returns whether this file buffer is synchronized with the file system. This is when
- * the file buffer's underlying file is in synchronization with the file system and the file buffer
- * has been initialized after the underlying files has been modified the last time.
- *
- * @return <code>true</code> if the file buffer is synchronized with the file system
- */
- boolean isSynchronized();
-
- /**
- * Reverts the contents of this file buffer to the content of its underlying file. After
- * that call successfully returned, <code>isDirty</code> returns <code>false</code> and
- * <code>isSynchronized</code> returns <code>true</code>.
- *
- * @param monitor the progress monitor
- * @throws CoreException if reading or accessing the underlying file fails
- */
- void revert(IProgressMonitor monitor) throws CoreException;
-
- /**
- * Commits this file buffer by changing the contents of the underlying file to
- * the contents of this file buffer. After that call, <code>isDirty</code>
- * returns <code>false</code> and <code>isSynchronized</code> returns
- * <code>true</code>.
- *
- * @param monitor the progress monitor
- * @param overwrite indicates whether the underlying file should be overwritten if it is not synchronized with the file system
- * @throws CoreException if writing or accessing the underlying file fails
- */
- void commit(IProgressMonitor monitor, boolean overwrite) throws CoreException;
-
- /**
- * Returns whether changes have been applied to this file buffer since initialization, or the most
- * recent <code>revert</code> or <code>commit</code> call.
- *
- * @return <code>true</code> if changes have been applied to this buffer
- */
- boolean isDirty();
-
- /**
- * Returns whether this file buffer is shared by more than one client.
- *
- * @return <code>true</code> if this file buffer is shared by more than one client
- */
- boolean isShared();
-
- /**
- * Validates the state of this file buffer and tries to bring the buffer's
- * underlying file into a state in which it can be modified. If state
- * validation is not supported this operation does nothing.
- *
- * @param monitor the progress monitor
- * @param computationContext the context in which the validation is
- * performed, e.g., a SWT shell
- * @exception CoreException if the underlying file can not be accessed to
- * it's state cannot be changed
- */
- void validateState(IProgressMonitor monitor, Object computationContext) throws CoreException;
-
- /**
- * Returns whether the state of this file buffer has been validated. If
- * state validation is not supported this method always returns <code>true</code>.
- *
- * @return <code>true</code> if the state has been validated, <code>false</code>
- * otherwise
- */
- boolean isStateValidated();
-
- /**
- * Resets state validation. If state validation is supported, <code>isStateValidated</code>
- * afterwards returns <code>false</code> until the state is revalidated.
- */
- void resetStateValidation();
-
- /**
- * Returns the status of this file buffer. This is the result of the last operation performed on this file buffer or
- * internally initiated by this file buffer.
- *
- * @return the status of this file buffer
- */
- IStatus getStatus();
-
- /**
- * Returns the modification stamp of the file underlying this file buffer.
- *
- * @return the modification stamp of the file underlying this file buffer
- */
- long getModificationStamp();
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBufferListener.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBufferListener.java
deleted file mode 100644
index 366af3018..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBufferListener.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-import org.eclipse.core.runtime.IPath;
-
-/**
- * Interface for listeners to file buffer changes.
- *
- * @since 3.0
- */
-public interface IFileBufferListener {
-
- /**
- * Informs the listener about the creation of the given buffer.
- *
- * @param buffer the created file buffer
- */
- void bufferCreated(IFileBuffer buffer);
-
- /**
- * Informs the listener about the disposal of the given buffer.
- *
- * @param buffer the disposed file buffer
- */
- void bufferDisposed(IFileBuffer buffer);
-
- /**
- * Informs the listener about an upcoming replace of the contents of the given buffer.
- *
- * @param buffer the effected file buffer
- */
- void bufferContentAboutToBeReplaced(IFileBuffer buffer);
-
- /**
- * Informs the listener that the buffer of the given buffer has been replaced.
- *
- * @param buffer the effected file buffer
- */
- void bufferContentReplaced(IFileBuffer buffer);
-
- /**
- * Informs the listener about the start of a state changing operation on
- * the given buffer.
- *
- * @param buffer the effected file buffer
- */
- void stateChanging(IFileBuffer buffer);
-
- /**
- * Informs the listener that the dirty state of the given buffer changed
- * to the specified value
- *
- * @param buffer the effected file buffer
- * @param isDirty <code>true</code> if the buffer is dirty, <code>false</code> otherwise
- */
- void dirtyStateChanged(IFileBuffer buffer, boolean isDirty);
-
- /**
- * Informs the listener that the state validation changed to the specified value.
- *
- * @param buffer the effected file buffer
- * @param isStateValidated <code>true</code> if the buffer state is validated, <code>false</code> otherwise
- */
- void stateValidationChanged(IFileBuffer buffer, boolean isStateValidated);
-
- /**
- * Informs the listener that the file underlying the given file buffer has been moved to the
- * given location.
- *
- * @param buffer the effected file buffer
- * @param path the new location (not just the container)
- */
- void underlyingFileMoved(IFileBuffer buffer, IPath path);
-
- /**
- * Informs the listener that the file underlying the given file buffer has been deleted.
- *
- * @param buffer the effected file buffer
- */
- void underlyingFileDeleted(IFileBuffer buffer);
-
- /**
- * Informs the listener that a state changing operation on the given
- * file buffer failed.
- *
- * @param buffer the effected file buffer
- */
- void stateChangeFailed(IFileBuffer buffer);
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBufferManager.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBufferManager.java
deleted file mode 100644
index bde4ee66a..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IFileBufferManager.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-
-/**
- * A file buffer manager manages file buffers for files while the files are
- * connected to the file buffer manager. In order to connect a file to a file
- * buffer manager call <code>connect</code>. After that call has
- * successfully completed the file buffer can be obtained by <code>getFileBuffer</code>.
- * The file buffer is created on the first connect and disposed on the last
- * disconnect. I.e. the file buffer manager keeps track of how often a file is
- * connected and returns the same file buffer to each client as long as the
- * file is connected.
- *
- * @since 3.0
- */
-public interface IFileBufferManager {
-
- /**
- * Connects the file at the given location to this manager. After that call
- * successfully completed it is guaranteed that each call to <code>getFileBuffer</code>
- * returns the same file buffer until <code>disconnect</code> is called.
- * <p>
- * The provided location is either a full path of a workspace resource or
- * an absolute path in the local file system. The file buffer manager does
- * not resolve the location of workspace resources in the case of linked
- * resources.
- * </p>
- *
- * @param location the location of the file to be connected
- * @param monitor the progress monitor
- * @throws CoreException if the file could not successfully be connected
- */
- void connect(IPath location, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Disconnects the file at the given location from this manager. After that
- * call successfully completed there is no guarantee that <code>getFileBuffer</code>
- * will return a valid file buffer.
- * <p>
- * The provided location is either a full path of a workspace resource or
- * an absolute path in the local file system. The file buffer manager does
- * not resolve the location of workspace resources in the case of linked
- * resources.
- * </p>
- *
- * @param location the location of the file to be disconnected
- * @param monitor the progress monitor
- * @throws CoreException if the file could not successfully be disconnected
- */
- void disconnect(IPath location, IProgressMonitor monitor) throws CoreException;
-
- /**
- * Returns the file buffer managed for the given location or <code>null</code>
- * if there is no such file buffer.
- * <p>
- * The provided location is either a full path of a workspace resource or
- * an absolute path in the local file system. The file buffer manager does
- * not resolve the location of workspace resources in the case of linked
- * resources.
- * </p>
- *
- * @param location the location
- * @return the file buffer managed for that location or <code>null</code>
- */
- IFileBuffer getFileBuffer(IPath location);
-
- /**
- * Sets the synchronization context for this file buffer manager, i.e., for
- * all file buffers this manager manages.
- *
- * @param context the synchronization context managed by this file buffer
- * manager
- */
- void setSynchronizationContext(ISynchronizationContext context);
-
- /**
- * The caller requests that the synchronization context is used to
- * synchronize the given location with its file buffer. This call as no
- * effect if there is no file buffer managed for the given location.
- * <p>
- * The provided location is either a full path of a workspace resource or an
- * absolute path in the local file system. The file buffer manager does not
- * resolve the location of workspace resources in the case of linked
- * resources.
- * </p>
- *
- * @param location the location
- */
- void requestSynchronizationContext(IPath location);
-
- /**
- * The caller no longer requests the synchronization context for the file
- * buffer managed for the given location. This method has no effect if there
- * is no file buffer managed for this location.
- * <p>
- * The provided location is either a full path of a workspace resource or an
- * absolute path in the local file system. The file buffer manager does not
- * resolve the location of workspace resources in the case of linked
- * resources.
- * </p>
- *
- * @param location the location
- */
- void releaseSynchronizationContext(IPath location);
-
- /**
- * Adds the given listener to the list of file buffer listeners. After that
- * call the listener is informed about changes related to this file
- * buffer manager. If the listener is already registered with the file buffer, this
- * call has no effect.
- *
- * @param listener the listener to be added
- */
- void addFileBufferListener(IFileBufferListener listener);
-
- /**
- * Removes the given listener from the list of file buffer listeners. If
- * the listener is not registered with this file buffer, this call has no
- * effect.
- *
- * @param listener the listener to be removed
- */
- void removeFileBufferListener(IFileBufferListener listener);
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IPersistableAnnotationModel.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IPersistableAnnotationModel.java
deleted file mode 100644
index 82c681d5c..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/IPersistableAnnotationModel.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-
-import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.jface.text.IDocument;
-
-
-
-/**
- * Tagging interface for {@link org.eclipse.jface.text.source.IAnnotationModel} implementers that offer
- * state persistence.
- *
- * @since 3.0
- */
-public interface IPersistableAnnotationModel {
-
- /**
- * Transforms the current transient state of the annotation model into a
- * persistent state.
- *
- * @param document the document the annotation model is connected to
- * @throws CoreException in case the transformation fails
- */
- void commit(IDocument document) throws CoreException;
-
- /**
- * Changes the current transient state of the annotation model to match the
- * last persisted state.
- *
- * @param document the document the annotation model is connected to
- * @throws CoreException in case accessing the persisted state
- */
- void revert(IDocument document) throws CoreException;
-
- /**
- * Forces this annotation model to re-initialize from the persistent state.
- * The persistent state must not be the same as the last persisted state.
- * I.e. external modification may have caused changes to the persistent
- * state since the last <code>commit</code> or <code>revert</code>
- * operation.
- *
- * @param document the document the annotation model is connected to
- * @throws CoreException in case accessing the persistent state fails
- */
- void reinitialize(IDocument document) throws CoreException;
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ISynchronizationContext.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ISynchronizationContext.java
deleted file mode 100644
index bb27c5bf1..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ISynchronizationContext.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-/**
- * A file buffer manager (see
- * {@link org.eclipse.core.filebuffers.IFileBufferManager}uses a
- * <code>ISynchronizationContext</code> in order to execute commands
- * encapsulated as {@link java.lang.Runnable}. The synchronization context
- * executes the <code>Runnables</code> according to a specific
- * synchronization/execution policy. This could be that the given
- * <code>Runnable</code> is executed in a specific thread or environment or
- * adhere to specific timing constraints. The concrete characteristics of the
- * policy is to be specified by the context implementer.
- * <p>
- * This interface can be implemented by clients. Clients use
- * {@link org.eclipse.core.filebuffers.IFileBufferManager#setSynchronizationContext(ISynchronizationContext)}
- * to install a particular synchronization context with a file buffer manager.
- *
- * @since 3.0
- */
-public interface ISynchronizationContext {
-
- /**
- * Executes the given runnable according to the specified
- * synchronization/execution policy.
- *
- *
- * @param runnable the runnable to be executed
- */
- void run(Runnable runnable);
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBuffer.java
deleted file mode 100644
index 74ee3df92..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBuffer.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-/**
- * A text file buffer is a file buffer for text files. The contents of a text
- * file buffer is given in the form of a document and an associated annotation
- * model. Also, the text file buffer provides methods to manage the character
- * encoding used to read and write the buffer's underlying text file.
- *
- * @since 3.0
- */
-public interface ITextFileBuffer extends IFileBuffer {
-
- /**
- * Returns the document of this text file buffer.
- *
- * @return the document of this text file buffer
- */
- IDocument getDocument();
-
- /**
- * Returns the character encoding to be used for reading and writing the
- * buffer's underlying file.
- *
- * @return the character encoding
- */
- String getEncoding();
-
- /**
- * Sets the character encoding to be used for reading and writing the buffer's
- * underlying file.
- *
- * @param encoding the encoding
- */
- void setEncoding(String encoding);
-
- /**
- * Returns the annotation model of this text file buffer.
- *
- * @return the annotation model of this text file buffer
- */
- IAnnotationModel getAnnotationModel();
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBufferManager.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBufferManager.java
deleted file mode 100644
index 846a46671..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/ITextFileBufferManager.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.filebuffers;
-
-
-import org.eclipse.core.runtime.IPath;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-
-/**
- * A text file buffer manager manages text file buffers for files whose contents
- * is considered text.
- *
- * @since 3.0
- */
-public interface ITextFileBufferManager extends IFileBufferManager {
-
- /**
- * Returns the text file buffer managed for the file at the given location
- * or <code>null</code> if either there is no such text file buffer.
- * <p>
- * The provided location is either a full path of a workspace resource or
- * an absolute path in the local file system. The file buffer manager does
- * not resolve the location of workspace resources in the case of linked
- * resources.
- * </p>
- *
- * @param location the location
- * @return the text file buffer managed for that location or <code>null</code>
- */
- ITextFileBuffer getTextFileBuffer(IPath location);
-
- /**
- * Returns the default encoding that is used to read the contents of text files
- * if no other encoding is specified.
- *
- * @return the default text file encoding
- */
- String getDefaultEncoding();
-
- /**
- * Creates a new empty document . The document is set up in the same way as
- * it would be used in a text file buffer for a file at the given location.
- * <p>
- * The provided location is either a full path of a workspace resource or
- * an absolute path in the local file system. The file buffer manager does
- * not resolve the location of workspace resources in the case of linked
- * resources.
- * </p>
- *
- * @param location the location used to set up the newly created document
- * @return a new empty document
- */
- IDocument createEmptyDocument(IPath location);
-
- /**
- * Creates a new annotation for the given location.
- *
- * @param location the location
- * @return the newly created annotation model
- */
- IAnnotationModel createAnnotationModel(IPath location);
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/package.html b/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/package.html
deleted file mode 100644
index 419fe4780..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/filebuffers/package.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html><head>
- <meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
- <meta content="IBM" name="Author">
- <meta content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]" name="GENERATOR"><title>text infrastructure</title></head>
-
-<body>
-<p>Provides the API for accessing file buffers.</p>
-<h3>Package Specification</h3>
-<p>File buffers represent a file that is being edited. Text file buffers are
- specific for text files. They represent the content of a text file in form of
- an <tt>IDocument</tt> and and associated <tt>IAnnotationModel</tt>. File buffers are managed by
- a file buffer manager. The <tt>org.eclipse.core.filebuffers</tt> plug-in provides a default
- file buffer manager that can be obtained by calling <tt>FileBuffers.getTextFileBufferManager()</tt>.
- The file buffer manager supports listeners, <tt>IFileBufferListener</tt>, that are informed about all relevant
- state changes of file buffers as well as their creation and disposal.</p>
-</body></html> \ No newline at end of file
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/AbstractFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/AbstractFileBuffer.java
deleted file mode 100644
index f0721e247..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/AbstractFileBuffer.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filebuffers;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.core.filebuffers.IFileBuffer;
-
-/**
- * @since 3.0
- */
-public abstract class AbstractFileBuffer implements IFileBuffer {
-
-
- public abstract void create(IPath location, IProgressMonitor monitor) throws CoreException;
-
- public abstract void connect();
-
- public abstract void disconnect() throws CoreException;
-
- public abstract boolean isDisposed();
-
- public abstract void requestSynchronizationContext();
-
- public abstract void releaseSynchronizationContext();
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ContainerGenerator.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ContainerGenerator.java
deleted file mode 100644
index ec5f82f83..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ContainerGenerator.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filebuffers;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-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.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-
-public class ContainerGenerator {
-
- private IPath fContainerFullPath;
- private IContainer fContainer;
- private IWorkspace fWorkspace;
-
- public ContainerGenerator(IWorkspace workspace, IPath containerPath) {
- fWorkspace= workspace;
- fContainerFullPath = containerPath;
- }
-
- private IFolder createFolder(IFolder folderHandle, IProgressMonitor monitor) throws CoreException {
- folderHandle.create(false, true, monitor);
- if (monitor.isCanceled())
- throw new OperationCanceledException();
- return folderHandle;
- }
-
- private IFolder createFolderHandle(IContainer container, String folderName) {
- return container.getFolder(new Path(folderName));
- }
-
- private IProject createProject(IProject projectHandle, IProgressMonitor monitor) throws CoreException {
- try {
- monitor.beginTask("",2000);//$NON-NLS-1$
-
- projectHandle.create(new SubProgressMonitor(monitor, 1000));
- if (monitor.isCanceled())
- throw new OperationCanceledException();
-
- projectHandle.open(new SubProgressMonitor(monitor, 1000));
- if (monitor.isCanceled())
- throw new OperationCanceledException();
-
- } finally {
- monitor.done();
- }
-
- return projectHandle;
- }
-
- private IProject createProjectHandle(IWorkspaceRoot root, String projectName) {
- return root.getProject(projectName);
- }
-
- public IContainer generateContainer(IProgressMonitor monitor) throws CoreException {
- IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- monitor.beginTask(FileBuffersMessages.getString("ContainerGenerator.task.creatingContainer"), 1000 * fContainerFullPath.segmentCount()); //$NON-NLS-1$
- if (fContainer != null)
- return;
-
- // Does the container exist already?
- IWorkspaceRoot root= fWorkspace.getRoot();
- IResource found= root.findMember(fContainerFullPath);
- if (found instanceof IContainer) {
- fContainer= (IContainer) found;
- return;
- } else if (found != null) {
- // fContainerFullPath specifies a file as directory
- throw new CoreException(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getFormattedString("ContainerGenerator.destinationMustBeAContainer", fContainerFullPath), null)); //$NON-NLS-1$
- }
-
- // Create the container for the given path
- fContainer= root;
- for (int i = 0; i < fContainerFullPath.segmentCount(); i++) {
- String currentSegment = fContainerFullPath.segment(i);
- IResource resource = fContainer.findMember(currentSegment);
- if (resource != null) {
- if (resource instanceof IContainer) {
- fContainer= (IContainer) resource;
- monitor.worked(1000);
- } else {
- // fContainerFullPath specifies a file as directory
- throw new CoreException(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getFormattedString("ContainerGenerator.destinationMustBeAContainer", resource.getFullPath()), null)); //$NON-NLS-1$
- }
- }
- else {
- if (i == 0) {
- IProject projectHandle= createProjectHandle(root, currentSegment);
- fContainer= createProject(projectHandle, new SubProgressMonitor(monitor,1000));
- }
- else {
- IFolder folderHandle= createFolderHandle(fContainer, currentSegment);
- fContainer= createFolder(folderHandle, new SubProgressMonitor(monitor,1000));
- }
- }
- }
- }
- };
-
- // Get scheduling rule
- IWorkspaceRoot root= fWorkspace.getRoot();
- IPath existingParentPath= fContainerFullPath;
- while (!root.exists(existingParentPath))
- existingParentPath= existingParentPath.removeLastSegments(1);
-
- IResource schedulingRule= root.findMember(existingParentPath);
- fWorkspace.run(runnable, schedulingRule, IWorkspace.AVOID_UPDATE, monitor);
- return fContainer;
- }
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/DefaultDocumentFactory.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/DefaultDocumentFactory.java
deleted file mode 100644
index 61ab7ca3b..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/DefaultDocumentFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filebuffers;
-
-import org.eclipse.core.filebuffers.IDocumentFactory;
-
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-
-/**
- * The default document factory.
- */
-public class DefaultDocumentFactory implements IDocumentFactory {
-
- public DefaultDocumentFactory() {
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IDocumentFactory#createDocument()
- */
- public IDocument createDocument() {
- return new Document();
- }
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java
deleted file mode 100644
index f1926c693..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ExtensionsRegistry.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filebuffers;
-
-
-
-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 java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.ILog;
-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.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.IAnnotationModelFactory;
-import org.eclipse.core.filebuffers.IDocumentFactory;
-import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
-
-import org.eclipse.jface.text.Assert;
-
-
-/**
- * This registry manages sharable document factories. Document factories are specified
- * in <code>plugin.xml</code> per file name extension.
- */
-public class ExtensionsRegistry {
-
- /**
- * Adapts IContentType with the ability to check
- * equality. This allows to use them in a collection.
- */
- private static class ContentTypeAdapter {
-
- /** The adapted content type. */
- private IContentType fContentType;
-
- /**
- * Creates a new content type adapter for the
- * given content type.
- *
- * @param contentType the content type to be adapted
- */
- public ContentTypeAdapter(IContentType contentType) {
- Assert.isNotNull(contentType);
- fContentType= contentType;
- }
-
- /**
- * Return the adapted content type.
- *
- * @return the content type
- */
- public IContentType getContentType() {
- return fContentType;
- }
-
- /**
- * Return the Id of the adapted content type.
- *
- * @return the Id
- */
- public String getId() {
- return fContentType.getId();
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
- return obj instanceof ContentTypeAdapter && fContentType.getId().equals(((ContentTypeAdapter)obj).getId());
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fContentType.getId().hashCode();
- }
- }
-
- private final static String WILDCARD= "*"; //$NON-NLS-1$
-
- /** The mapping between file attributes and configuration elements describing document factories. */
- private Map fFactoryDescriptors= new HashMap();
- /** The mapping between configuration elements for document factories and instantiated document factories. */
- private Map fFactories= new HashMap();
- /** The mapping between file attributes and configuration elements describing document setup participants. */
- private Map fSetupParticipantDescriptors= new HashMap();
- /** The mapping between configuration elements for setup participants and instantiated setup participants. */
- private Map fSetupParticipants= new HashMap();
- /** The mapping between file attributes and configuration elements describing annotation model factories. */
- private Map fAnnotationModelFactoryDescriptors= new HashMap();
- /** The mapping between configuration elements for annotation model factories */
- private Map fAnnotationModelFactories= new HashMap();
- /** The content type manager. */
- private IContentTypeManager fContentTypeManager= Platform.getContentTypeManager();
-
-
- /**
- * Creates a new document factory registry and initializes it with the information
- * found in the plug-in registry.
- */
- public ExtensionsRegistry() {
- initialize("documentCreation", "contentTypeId", true, fFactoryDescriptors); //$NON-NLS-1$ //$NON-NLS-2$
- initialize("documentCreation", "fileNames", false, fFactoryDescriptors); //$NON-NLS-1$ //$NON-NLS-2$
- initialize("documentCreation", "extensions", false, fFactoryDescriptors); //$NON-NLS-1$ //$NON-NLS-2$
- initialize("documentSetup", "contentTypeId", true, fSetupParticipantDescriptors); //$NON-NLS-1$ //$NON-NLS-2$
- initialize("documentSetup", "fileNames", false, fSetupParticipantDescriptors); //$NON-NLS-1$ //$NON-NLS-2$
- initialize("documentSetup", "extensions", false, fSetupParticipantDescriptors); //$NON-NLS-1$ //$NON-NLS-2$
- initialize("annotationModelCreation", "contentTypeId", true, fAnnotationModelFactoryDescriptors); //$NON-NLS-1$ //$NON-NLS-2$
- initialize("annotationModelCreation", "fileNames", false, fAnnotationModelFactoryDescriptors); //$NON-NLS-1$ //$NON-NLS-2$
- initialize("annotationModelCreation", "extensions", false, fAnnotationModelFactoryDescriptors); //$NON-NLS-1$ //$NON-NLS-2$
-
- }
-
- /**
- * Reads the comma-separated value from the given configuration element for the given attribute name and remembers
- * the configuration element in the given map under the individual tokens of the attribute value.
- *
- * @param attributeName the name of the attribute
- * @param element the configuration element
- * @param map the map which remembers the configuration element
- */
- private void read(String attributeName, IConfigurationElement element, Map map) {
- String value= element.getAttribute(attributeName);
- if (value != null) {
- StringTokenizer tokenizer= new StringTokenizer(value, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens()) {
- String token= tokenizer.nextToken().trim();
-
- Set s= (Set) map.get(token);
- if (s == null) {
- s= new HashSet();
- map.put(token, s);
- }
- s.add(element);
- }
- }
- }
-
- /**
- * Reads the value from the given configuration element for the given attribute name and remembers
- * the configuration element in the given map under the individual content type of the attribute value.
- *
- * @param attributeName the name of the attribute
- * @param element the configuration element
- * @param map the map which remembers the configuration element
- */
- private void readContentType(String attributeName, IConfigurationElement element, Map map) {
- String value= element.getAttribute(attributeName);
- if (value != null) {
- IContentType contentType= fContentTypeManager.getContentType(value);
- if (contentType == null) {
- log(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, 0, FileBuffersMessages.getFormattedString("ExtensionsRegistry.error.contentTypeDoesNotExist", new Object[] { value }), null)); //$NON-NLS-1$
- return;
- }
- ContentTypeAdapter adapter= new ContentTypeAdapter(contentType);
- Set s= (Set) map.get(adapter);
- if (s == null) {
- s= new HashSet();
- map.put(adapter, s);
- }
- s.add(element);
- }
- }
-
- /**
- * Adds an entry to the log of this plug-in for the given status
- * @param status the status to log
- */
- private void log(IStatus status) {
- ILog log= FileBuffersPlugin.getDefault().getLog();
- log.log(status);
- }
-
- /**
- * Initializes this registry. It retrieves all implementers of the given
- * extension point and remembers those implementers based on the
- * file name extensions in the given map.
- *
- * @param extensionPointName the name of the extension point
- * @param childElementName the name of the child elements
- * @param isContentTypeId the child element is a content type id
- * @param descriptors the map to be filled
- */
- private void initialize(String extensionPointName, String childElementName, boolean isContentTypeId, Map descriptors) {
-
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(FileBuffersPlugin.PLUGIN_ID, extensionPointName);
- if (extensionPoint == null) {
- log(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, 0, FileBuffersMessages.getFormattedString("ExtensionsRegistry.error.extensionPointNotFound", new Object[] { extensionPointName}), null)); //$NON-NLS-1$
- return;
- }
-
- IConfigurationElement[] elements= extensionPoint.getConfigurationElements();
- for (int i= 0; i < elements.length; i++) {
- if (isContentTypeId)
- readContentType(childElementName, elements[i], descriptors);
- else
- read(childElementName, elements[i], descriptors);
- }
- }
-
- /**
- * Returns the executable extension for the given configuration element.
- * If there is no instantiated extension remembered for this
- * element, a new extension is created and put into the cache if it is of the requested type.
- *
- * @param entry the configuration element
- * @param extensions the map of instantiated extensions
- * @param extensionType the requested result type
- * @return the executable extension for the given configuration element.
- */
- private Object getExtension(IConfigurationElement entry, Map extensions, Class extensionType) {
- Object extension= extensions.get(entry);
- if (extension != null)
- return extension;
-
- try {
- extension= entry.createExecutableExtension("class"); //$NON-NLS-1$
- } catch (CoreException x) {
- log(x.getStatus());
- }
-
- if (extensionType.isInstance(extension)) {
- extensions.put(entry, extension);
- return extension;
- }
-
- return null;
- }
-
- /**
- * Returns the first enumerated element of the given set.
- *
- * @param set the set from which to choose
- * @return the selected configuration element
- */
- private IConfigurationElement selectConfigurationElement(Set set) {
- if (set != null && !set.isEmpty()) {
- Iterator e= set.iterator();
- return (IConfigurationElement) e.next();
- }
- return null;
- }
-
- /**
- * Returns a sharable document factory for the given file name or file extension.
- *
- * @param nameOrExtension the name or extension to be used for lookup
- * @return the sharable document factory or <code>null</code>
- */
- private IDocumentFactory getDocumentFactory(String nameOrExtension) {
- Set set= (Set) fFactoryDescriptors.get(nameOrExtension);
- if (set != null) {
- IConfigurationElement entry= selectConfigurationElement(set);
- return (IDocumentFactory) getExtension(entry, fFactories, IDocumentFactory.class);
- }
- return null;
- }
-
- /**
- * Returns a sharable document factory for the given content types.
- *
- * @param contentTypes the content types used to find the factory
- * @return the sharable document factory or <code>null</code>
- */
- private IDocumentFactory doGetDocumentFactory(IContentType[] contentTypes) {
- Set set= null;
- int i= 0;
- while (i < contentTypes.length && set == null) {
- set= (Set) fFactoryDescriptors.get(new ContentTypeAdapter(contentTypes[i++]));
- }
-
- if (set != null) {
- IConfigurationElement entry= selectConfigurationElement(set);
- return (IDocumentFactory) getExtension(entry, fFactories, IDocumentFactory.class);
- }
- return null;
- }
-
- /**
- * Returns a sharable document factory for the given content types. This
- * method considers the base content types of the given set of content
- * types.
- *
- * @param contentTypes the content types used to find the factory
- * @return the sharable document factory or <code>null</code>
- */
- private IDocumentFactory getDocumentFactory(IContentType[] contentTypes) {
- IDocumentFactory factory= doGetDocumentFactory(contentTypes);
- while (factory == null) {
- contentTypes= computeBaseContentTypes(contentTypes);
- if (contentTypes == null)
- break;
- factory= doGetDocumentFactory(contentTypes);
- }
- return factory;
- }
-
- /**
- * Returns the set of setup participants for the given file name or extension.
- *
- * @param nameOrExtension the name or extension to be used for lookup
- * @return the sharable set of document setup participants
- */
- private List getDocumentSetupParticipants(String nameOrExtension) {
- Set set= (Set) fSetupParticipantDescriptors.get(nameOrExtension);
- if (set == null)
- return null;
-
- List participants= new ArrayList();
- Iterator e= set.iterator();
- while (e.hasNext()) {
- IConfigurationElement entry= (IConfigurationElement) e.next();
- Object participant= getExtension(entry, fSetupParticipants, IDocumentSetupParticipant.class);
- if (participant != null)
- participants.add(participant);
- }
-
- return participants;
- }
-
- /**
- * Returns the set of setup participants for the given content types.
- *
- * @param contentTypes the contentTypes to be used for lookup
- * @return the sharable set of document setup participants
- */
- private List doGetDocumentSetupParticipants(IContentType[] contentTypes) {
- Set resultSet= new HashSet();
- int i= 0;
- while (i < contentTypes.length) {
- Set set= (Set) fSetupParticipantDescriptors.get(new ContentTypeAdapter(contentTypes[i++]));
- if (set != null)
- resultSet.addAll(set);
- }
-
- List participants= new ArrayList();
- Iterator e= resultSet.iterator();
- while (e.hasNext()) {
- IConfigurationElement entry= (IConfigurationElement) e.next();
- Object participant= getExtension(entry, fSetupParticipants, IDocumentSetupParticipant.class);
- if (participant != null)
- participants.add(participant);
- }
-
- return participants.isEmpty() ? null : participants;
- }
-
- /**
- * Returns the set of setup participants for the given content types. This
- * method considers the base content types of the given set of content
- * types.
- *
- * @param contentTypes the contentTypes to be used for lookup
- * @return the sharable set of document setup participants
- */
- private List getDocumentSetupParticipants(IContentType[] contentTypes) {
- List participants= doGetDocumentSetupParticipants(contentTypes);
- while (participants == null) {
- contentTypes= computeBaseContentTypes(contentTypes);
- if (contentTypes == null)
- break;
- participants= doGetDocumentSetupParticipants(contentTypes);
- }
- return participants;
- }
-
- /**
- * Returns a sharable annotation model factory for the given content types.
- *
- * @param contentTypes the content types used to find the factory
- * @return the sharable annotation model factory or <code>null</code>
- */
- private IAnnotationModelFactory doGetAnnotationModelFactory(IContentType[] contentTypes) {
- Set set= null;
- int i= 0;
- while (i < contentTypes.length && set == null) {
- set= (Set) fAnnotationModelFactoryDescriptors.get(new ContentTypeAdapter(contentTypes[i++]));
- }
-
- if (set != null) {
- IConfigurationElement entry= selectConfigurationElement(set);
- return (IAnnotationModelFactory) getExtension(entry, fAnnotationModelFactories, IAnnotationModelFactory.class);
- }
- return null;
- }
-
- /**
- * Returns a sharable annotation model factory for the given content types.
- * This method considers the base content types of the given set of content
- * types.
- *
- * @param contentTypes the content types used to find the factory
- * @return the sharable annotation model factory or <code>null</code>
- */
- private IAnnotationModelFactory getAnnotationModelFactory(IContentType[] contentTypes) {
- IAnnotationModelFactory factory= doGetAnnotationModelFactory(contentTypes);
- while (factory == null) {
- contentTypes= computeBaseContentTypes(contentTypes);
- if (contentTypes == null)
- break;
- factory= doGetAnnotationModelFactory(contentTypes);
- }
- return factory;
- }
-
- /**
- * Returns a sharable annotation model factory for the given file name or file extension.
- *
- * @param extension the name or extension to be used for lookup
- * @return the sharable document factory or <code>null</code>
- */
- private IAnnotationModelFactory getAnnotationModelFactory(String extension) {
- Set set= (Set) fAnnotationModelFactoryDescriptors.get(extension);
- if (set != null) {
- IConfigurationElement entry= selectConfigurationElement(set);
- return (IAnnotationModelFactory) getExtension(entry, fAnnotationModelFactories, IAnnotationModelFactory.class);
- }
- return null;
- }
-
- /**
- * Returns the set of content types for the given location.
- *
- * @param location the location for which to look up the content types
- * @return the set of content types for the location
- */
- private IContentType[] findContentTypes(IPath location) {
- IFile file= FileBuffers.getWorkspaceFileAtLocation(location);
- if (file != null) {
- try {
- IContentDescription contentDescription= file.getContentDescription();
- if (contentDescription != null) {
- IContentType contentType= contentDescription.getContentType();
- if (contentType != null)
- return new IContentType[] {contentType};
- }
- } catch (CoreException x) {
- // go for the default
- }
- }
- return fContentTypeManager.findContentTypesFor(location.lastSegment());
- }
-
- /**
- * Returns the set of direct base content types for the given set of content
- * types. Returns <code>null</code> if non of the given content types has
- * a direct base content type.
- *
- * @param contentTypes the content types
- * @return the set of direct base content types
- */
- private IContentType[] computeBaseContentTypes(IContentType[] contentTypes) {
- List baseTypes= new ArrayList();
- for (int i= 0; i < contentTypes.length; i++) {
- IContentType baseType= contentTypes[i].getBaseType();
- if (baseType != null)
- baseTypes.add(baseType);
- }
-
- IContentType[] result= null;
- int size= baseTypes.size();
- if (size > 0) {
- result= new IContentType[size];
- baseTypes.toArray(result);
- }
- return result;
- }
-
- /**
- * Returns the sharable document factory for the given location.
- *
- * @param location the location for which to looked up the factory
- * @return the sharable document factory
- */
- public IDocumentFactory getDocumentFactory(IPath location) {
- IDocumentFactory factory= getDocumentFactory(findContentTypes(location));
- if (factory == null)
- factory= getDocumentFactory(location.lastSegment());
- if (factory == null)
- factory= getDocumentFactory(location.getFileExtension());
- if (factory == null)
- factory= getDocumentFactory(WILDCARD);
- return factory;
- }
-
- /**
- * Returns the sharable set of document setup participants for the given location.
- *
- * @param location the location for which to look up the setup participants
- * @return the sharable set of document setup participants
- */
- public IDocumentSetupParticipant[] getDocumentSetupParticipants(IPath location) {
- List participants= new ArrayList();
-
- List p= getDocumentSetupParticipants(findContentTypes(location));
- if (p != null)
- participants.addAll(p);
-
- p= getDocumentSetupParticipants(location.lastSegment());
- if (p != null)
- participants.addAll(p);
-
- p= getDocumentSetupParticipants(location.getFileExtension());
- if (p != null)
- participants.addAll(p);
-
- p= getDocumentSetupParticipants(WILDCARD);
- if (p != null)
- participants.addAll(p);
-
- IDocumentSetupParticipant[] result= new IDocumentSetupParticipant[participants.size()];
- participants.toArray(result);
- return result;
- }
-
- /**
- * Returns the sharable annotation model factory for the given location.
- *
- * @param location the location for which to look up the factory
- * @return the sharable annotation model factory
- */
- public IAnnotationModelFactory getAnnotationModelFactory(IPath location) {
- IAnnotationModelFactory factory= getAnnotationModelFactory(findContentTypes(location));
- if (factory == null)
- factory= getAnnotationModelFactory(location.lastSegment());
- if (factory == null)
- factory= getAnnotationModelFactory(location.getFileExtension());
- if (factory == null)
- factory= getAnnotationModelFactory(WILDCARD);
- return factory;
- }
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersMessages.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersMessages.java
deleted file mode 100644
index e3230fff2..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersMessages.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.core.internal.filebuffers;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-
-/**
- * Helper class to get NLSed messages.
- *
- * @since 3.0
- */
-class FileBuffersMessages {
-
- private static final String RESOURCE_BUNDLE= FileBuffersMessages.class.getName();
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private FileBuffersMessages() {
- }
-
- /**
- * Gets a string from the resource bundle.
- *
- * @param key the string used to get the bundle value, must not be <code>null</code>
- * @return the string from the resource bundle
- */
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- /**
- * Gets a string from the resource bundle and formats it with the given arguments.
- *
- * @param key the string used to get the bundle value, must not be <code>null</code>
- * @param args the arguments used to format the string
- * @return the formatted string
- */
- public static String getFormattedString(String key, Object[] args) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- return MessageFormat.format(format, args);
- }
-
- /**
- * Gets a string from the resource bundle and formats it with the given argument.
- *
- * @param key the string used to get the bundle value, must not be <code>null</code>
- * @param arg the argument used to format the string
- * @return the formatted string
- */
- public static String getFormattedString(String key, Object arg) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- if (arg == null)
- arg= ""; //$NON-NLS-1$
- return MessageFormat.format(format, new Object[] { arg });
- }
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersMessages.properties b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersMessages.properties
deleted file mode 100644
index efbe8b0d3..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersMessages.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-
-ExtensionsRegistry.error.extensionPointNotFound= Extension point "{0}" not found.
-ExtensionsRegistry.error.contentTypeDoesNotExist= The content type with id "{0}" specified in the extension point does not exist.
-
-FileBuffer.error.fileDoesNotExist= The file does not exist.
-FileBuffer.error.outOfSync= The file is not synchronized with the the local file system.
-
-FileBuffer.status.ok= OK
-FileBuffer.status.error= Error
-
-FileBufferManager.error.canNotCreateFilebuffer= Cannot create file buffer.
-
-ContainerGenerator.task.creatingContainer= Creating container...
-ContainerGenerator.destinationMustBeAContainer=Specified path is not a folder: {0}
-
-ResourceTextFileBuffer.error.unsupported_encoding.message_arg= Character encoding \"{0}\" is not supported by this platform.
-ResourceTextFileBuffer.error.closeReader= Could not close reader.
-
-JavaTextFileBuffer.error.closeStream= Could not close stream.
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersPlugin.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersPlugin.java
deleted file mode 100644
index 14610ace3..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileBuffersPlugin.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filebuffers;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.Plugin;
-
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-
-import org.eclipse.jface.text.Assert;
-
-
-/**
- * The plug-in runtime class for the file buffers plug-in (id <code>"org.eclipse.core.filebuffers"</code>).
- *
- * @since 3.0
- */
-public class FileBuffersPlugin extends Plugin {
-
- public final static String PLUGIN_ID= "org.eclipse.core.filebuffers"; //$NON-NLS-1$
-
- /** The shared plug-in instance */
- private static FileBuffersPlugin fgPlugin;
- /** The resource bundle */
- private ResourceBundle fResourceBundle;
- /** The file buffer manager */
- private ITextFileBufferManager fTextFileBufferManager;
-
- /**
- * Creates a plug-in instance.
- */
- public FileBuffersPlugin() {
- Assert.isTrue(fgPlugin == null);
- fgPlugin= this;
- try {
- fResourceBundle= ResourceBundle.getBundle("org.eclipse.core.internal.filebuffers.FileBuffersPlugin"); //$NON-NLS-1$
- } catch (MissingResourceException x) {
- fResourceBundle = null;
- }
- }
-
- /**
- * Returns the shared instance.
- *
- * @return the default plug-in instance
- */
- public static FileBuffersPlugin getDefault() {
- return fgPlugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- *
- * @param key the resource string key
- * @return the resource string for the given key
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle= FileBuffersPlugin.getDefault().getResourceBundle();
- try {
- return (bundle!=null ? bundle.getString(key) : key);
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle.
- *
- * @return the resource bundle
- */
- private ResourceBundle getResourceBundle() {
- return fResourceBundle;
- }
-
- /**
- * Returns the text file buffer manager of this plug-in.
- *
- * @return the text file buffer manager of this plug-in
- */
- public ITextFileBufferManager getFileBufferManager() {
- if (fTextFileBufferManager == null)
- fTextFileBufferManager= new TextFileBufferManager();
- return fTextFileBufferManager;
- }
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaFileBuffer.java
deleted file mode 100644
index 5b8b3535f..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaFileBuffer.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filebuffers;
-
-import java.io.File;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ILog;
-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.core.filebuffers.FileBuffers;
-
-/**
- * @since 3.0
- */
-public abstract class JavaFileBuffer extends AbstractFileBuffer {
-
- /** The location */
- protected IPath fLocation;
- /** The element for which the info is stored */
- protected File fFile;
- /** How often the element has been connected */
- protected int fReferenceCount;
- /** Can the element be saved */
- protected boolean fCanBeSaved= false;
- /** The status of this element */
- protected IStatus fStatus;
- /** The time stamp at which this buffer synchronized with the underlying file. */
- protected long fSynchronizationStamp= IFile.NULL_STAMP;
- /** How often the synchronization context has been requested */
- protected int fSynchronizationContextCount;
- /** The text file buffer manager */
- protected TextFileBufferManager fManager;
-
-
- public JavaFileBuffer(TextFileBufferManager manager) {
- super();
- fManager= manager;
- }
-
- abstract protected void addFileBufferContentListeners();
-
- abstract protected void removeFileBufferContentListeners();
-
- abstract protected void initializeFileBufferContent(IProgressMonitor monitor) throws CoreException;
-
- abstract protected void commitFileBufferContent(IProgressMonitor monitor, boolean overwrite) throws CoreException;
-
- /**
- * Returns the file at the given location or <code>null</code> if
- * there is no such file.
- *
- * @param location the location
- * @return the file at the given location
- */
- private File getFileAtLocation(IPath location) {
- File file= FileBuffers.getSystemFileAtLocation(location);
- return file.exists() ? file : null;
- }
-
- public void create(IPath location, IProgressMonitor monitor) throws CoreException {
- File file= getFileAtLocation(location);
- if (file == null)
- throw new CoreException(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getString("FileBuffer.error.fileDoesNotExist"), null)); //$NON-NLS-1$
-
- fLocation= location;
- fFile= file;
- initializeFileBufferContent(monitor);
- fSynchronizationStamp= fFile.lastModified();
-
- addFileBufferContentListeners();
- }
-
- public void connect() {
- ++ fReferenceCount;
- }
-
- public void disconnect() throws CoreException {
- -- fReferenceCount;
- }
-
- /**
- * Returns whether this file buffer has already been disposed.
- *
- * @return <code>true</code> if already disposed, <code>false</code> otherwise
- */
- public boolean isDisposed() {
- return fReferenceCount <= 0;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#getLocation()
- */
- public IPath getLocation() {
- return fLocation;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#commit(org.eclipse.core.runtime.IProgressMonitor, boolean)
- */
- public void commit(IProgressMonitor monitor, boolean overwrite) throws CoreException {
- if (!isDisposed() && fCanBeSaved) {
-
- fManager.fireStateChanging(this);
-
- try {
- commitFileBufferContent(monitor, overwrite);
- } catch (CoreException x) {
- fManager.fireStateChangeFailed(this);
- throw x;
- } catch (RuntimeException x) {
- fManager.fireStateChangeFailed(this);
- throw x;
- }
-
- fCanBeSaved= false;
- addFileBufferContentListeners();
- fManager.fireDirtyStateChanged(this, fCanBeSaved);
- }
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#isDirty()
- */
- public boolean isDirty() {
- return fCanBeSaved;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#isShared()
- */
- public boolean isShared() {
- return fReferenceCount > 1;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#validateState(org.eclipse.core.runtime.IProgressMonitor, java.lang.Object)
- */
- public void validateState(IProgressMonitor monitor, Object computationContext) throws CoreException {
- // nop
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#isStateValidated()
- */
- public boolean isStateValidated() {
- return true;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#resetStateValidation()
- */
- public void resetStateValidation() {
- // nop
- }
-
- /**
- * Sends out the notification that the file serving as document input has been moved.
- *
- * @param newLocation the path of the new location of the file
- */
- protected void handleFileMoved(IPath newLocation) {
- fManager.fireUnderlyingFileMoved(this, newLocation);
- }
-
- /**
- * Defines the standard procedure to handle <code>CoreExceptions</code>. Exceptions
- * are written to the plug-in log.
- *
- * @param exception the exception to be logged
- * @param message the message to be logged
- */
- protected void handleCoreException(CoreException exception) {
- ILog log= FileBuffersPlugin.getDefault().getLog();
- log.log(exception.getStatus());
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#isSynchronized()
- */
- public boolean isSynchronized() {
- return fSynchronizationStamp == fFile.lastModified();
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#getModificationStamp()
- */
- public long getModificationStamp() {
- return fFile.lastModified();
- }
-
- /**
- * Requests the file buffer manager's synchronization context for this file buffer.
- */
- public void requestSynchronizationContext() {
- ++ fSynchronizationContextCount;
- }
-
- /**
- * Releases the file buffer manager's synchronization context for this file buffer.
- */
- public void releaseSynchronizationContext() {
- -- fSynchronizationContextCount;
- }
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java
deleted file mode 100644
index 28bdfcda6..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/JavaTextFileBuffer.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filebuffers;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IResourceStatus;
-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.QualifiedName;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentDescription;
-
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-/**
- * @since 3.0
- */
-public class JavaTextFileBuffer extends JavaFileBuffer implements ITextFileBuffer {
-
-
- private class DocumentListener implements IDocumentListener {
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent event) {
- fCanBeSaved= true;
- removeFileBufferContentListeners();
- fManager.fireDirtyStateChanged(JavaTextFileBuffer.this, fCanBeSaved);
- }
- }
-
- /**
- * Reader chunk size.
- */
- private static final int READER_CHUNK_SIZE= 2048;
- /**
- * Buffer size.
- */
- private static final int BUFFER_SIZE= 8 * READER_CHUNK_SIZE;
- /**
- * Constant for representing the OK status. This is considered a value object.
- */
- private static final IStatus STATUS_OK= new Status(IStatus.OK, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getString("FileBuffer.status.ok"), null); //$NON-NLS-1$
- /**
- * Constant for representing the error status. This is considered a value object.
- */
- private static final IStatus STATUS_ERROR= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.INFO, FileBuffersMessages.getString("FileBuffer.status.error"), null); //$NON-NLS-1$
- /**
- * Constant denoting UTF-8 encoding.
- */
- private static final String CHARSET_UTF_8= "UTF-8"; //$NON-NLS-1$
-
-
- /** The element's document */
- protected IDocument fDocument;
- /** The encoding used to create the document from the storage or <code>null</code> for workbench encoding. */
- protected String fEncoding;
- /** Internal document listener */
- protected IDocumentListener fDocumentListener= new DocumentListener();
- /**
- * The encoding which has explicitly been set on the file.
- */
- private String fExplicitEncoding;
- /**
- * Tells whether the file on disk has a BOM.
- */
- private boolean fHasBOM;
-
-
- public JavaTextFileBuffer(TextFileBufferManager manager) {
- super(manager);
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedTextFile#getDocument()
- */
- public IDocument getDocument() {
- return fDocument;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.ITextFileBuffer#getAnnotationModel()
- */
- public IAnnotationModel getAnnotationModel() {
- return null;
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedTextFile#getEncoding()
- */
- public String getEncoding() {
- return fEncoding;
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedTextFile#setEncoding(java.lang.String)
- */
- public void setEncoding(String encoding) {
- fEncoding= encoding;
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFile#getStatus()
- */
- public IStatus getStatus() {
- if (!isDisposed()) {
- if (fStatus != null)
- return fStatus;
- return (fDocument == null ? STATUS_ERROR : STATUS_OK);
- }
- return STATUS_ERROR;
- }
-
- private InputStream getFileContents(IProgressMonitor monitor) {
- try {
- return new FileInputStream(fFile);
- } catch (FileNotFoundException e) {
- }
- return null;
- }
-
- private void setFileContents(InputStream stream, boolean overwrite, IProgressMonitor monitor) {
- try {
- OutputStream out= new FileOutputStream(fFile, false);
-
- try {
- byte[] buffer = new byte[8192];
- while (true) {
- int bytesRead = -1;
- try {
- bytesRead = stream.read(buffer);
- } catch (IOException e) {
- }
- if (bytesRead == -1)
- break;
- try {
- out.write(buffer, 0, bytesRead);
- } catch (IOException e) {
- }
- monitor.worked(1);
- }
- } finally {
- try {
- stream.close();
- } catch (IOException e) {
- } finally {
- try {
- out.close();
- } catch (IOException e) {
- }
- }
- }
- } catch (FileNotFoundException e) {
- }
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#revert(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void revert(IProgressMonitor monitor) throws CoreException {
- if (isDisposed())
- return;
-
- IDocument original= null;
- IStatus status= null;
-
- try {
- original= fManager.createEmptyDocument(getLocation());
- setDocumentContent(original, getFileContents(monitor), fEncoding);
- } catch (CoreException x) {
- status= x.getStatus();
- }
-
- fStatus= status;
-
- if (original != null) {
-
- String originalContents= original.get();
- boolean replaceContents= !originalContents.equals(fDocument.get());
-
- if (replaceContents) {
- fManager.fireBufferContentAboutToBeReplaced(this);
- fDocument.set(original.get());
- }
-
- if (fCanBeSaved) {
- fCanBeSaved= false;
- addFileBufferContentListeners();
- }
-
- if (replaceContents)
- fManager.fireBufferContentReplaced(this);
-
- fManager.fireDirtyStateChanged(this, fCanBeSaved);
- }
- }
-
- /*
- * @see org.eclipse.core.internal.filebuffers.FileBuffer#addFileBufferContentListeners()
- */
- protected void addFileBufferContentListeners() {
- if (fDocument != null)
- fDocument.addDocumentListener(fDocumentListener);
- }
-
- /*
- * @see org.eclipse.core.internal.filebuffers.FileBuffer#removeFileBufferContentListeners()
- */
- protected void removeFileBufferContentListeners() {
- if (fDocument != null)
- fDocument.removeDocumentListener(fDocumentListener);
- }
-
- /*
- * @see org.eclipse.core.internal.filebuffers.FileBuffer#initializeFileBufferContent(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void initializeFileBufferContent(IProgressMonitor monitor) throws CoreException {
- try {
- fDocument= fManager.createEmptyDocument(getLocation());
- fEncoding= null;
- fHasBOM= false;
-
- InputStream stream= getFileContents(monitor);
- try {
- QualifiedName[] options= new QualifiedName[] { IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK };
- IContentDescription description= Platform.getContentTypeManager().getDescriptionFor(stream, fFile.getName(), options);
- if (description != null) {
- fEncoding= description.getCharset();
- fHasBOM= description.getProperty(IContentDescription.BYTE_ORDER_MARK) != null;
- }
- } catch (IOException e) {
- // do nothing
- } finally {
- try {
- stream.close();
- } catch (IOException ex) {
- FileBuffersPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getString("JavaTextFileBuffer.error.closeStream"), ex)); //$NON-NLS-1$
- }
- }
-
- setDocumentContent(fDocument, getFileContents(monitor), fEncoding);
- } catch (CoreException x) {
- fDocument= fManager.createEmptyDocument(getLocation());
- fStatus= x.getStatus();
- }
- }
-
- /*
- * @see org.eclipse.core.internal.filebuffers.FileBuffer#commitFileBufferContent(org.eclipse.core.runtime.IProgressMonitor, boolean)
- */
- protected void commitFileBufferContent(IProgressMonitor monitor, boolean overwrite) throws CoreException {
- String encoding= computeEncoding();
- try {
-
- byte[] bytes= fDocument.get().getBytes(encoding);
-
- /*
- * XXX:
- * This is a workaround for a corresponding bug in Java readers and writer,
- * see: http://developer.java.sun.com/developer/bugParade/bugs/4508058.html
- */
- if (fHasBOM && CHARSET_UTF_8.equals(encoding)) {
- int bomLength= IContentDescription.BOM_UTF_8.length;
- byte[] bytesWithBOM= new byte[bytes.length + bomLength];
- System.arraycopy(IContentDescription.BOM_UTF_8, 0, bytesWithBOM, 0, bomLength);
- System.arraycopy(bytes, 0, bytesWithBOM, bomLength, bytes.length);
- bytes= bytesWithBOM;
- }
-
- InputStream stream= new ByteArrayInputStream(bytes);
-
- if (fFile.exists()) {
-
- if (!overwrite)
- checkSynchronizationState();
-
-
- // here the file synchronizer should actually be removed and afterwards added again. However,
- // we are already inside an operation, so the delta is sent AFTER we have added the listener
- setFileContents(stream, overwrite, monitor);
- // set synchronization stamp to know whether the file synchronizer must become active
- fSynchronizationStamp= fFile.lastModified();
-
- // TODO if there is an annotation model update it here
-
- } else {
-
-// try {
-// monitor.beginTask("Saving", 2000); //$NON-NLS-1$
-// ContainerGenerator generator = new ContainerGenerator(fFile.getWorkspace(), fFile.getParent().getFullPath());
-// generator.generateContainer(new SubProgressMonitor(monitor, 1000));
-// fFile.create(stream, false, new SubProgressMonitor(monitor, 1000));
-// }
-// finally {
-// monitor.done();
-// }
-
- }
-
- } catch (UnsupportedEncodingException x) {
- String message= FileBuffersMessages.getFormattedString("ResourceTextFileBuffer.error.unsupported_encoding.message_arg", encoding); //$NON-NLS-1$
- IStatus s= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, message, x);
- throw new CoreException(s);
- }
- }
-
- private String computeEncoding() {
- // User-defined encoding has first priority
- if (fExplicitEncoding != null)
- return fExplicitEncoding;
-
- // Probe content
- Reader reader= new BufferedReader(new StringReader(fDocument.get()));
- try {
- QualifiedName[] options= new QualifiedName[] { IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK };
- IContentDescription description= Platform.getContentTypeManager().getDescriptionFor(reader, fFile.getName(), options);
- if (description != null) {
- String encoding= description.getCharset();
- if (encoding != null)
- return encoding;
- }
- } catch (IOException ex) {
- // try next strategy
- } finally {
- try {
- reader.close();
- } catch (IOException ex) {
- FileBuffersPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getString("ResourceTextFileBuffer.error.closeReader"), ex)); //$NON-NLS-1$
- }
- }
-
- // Use file's encoding if the file has a BOM
- if (fHasBOM)
- return fEncoding;
-
- // Use global default
- return fManager.getDefaultEncoding();
- }
-
- /**
- * Intitializes the given document with the given stream using the given encoding.
- *
- * @param document the document to be initialized
- * @param contentStream the stream which delivers the document content
- * @param encoding the character encoding for reading the given stream
- * @exception CoreException if the given stream can not be read
- */
- private void setDocumentContent(IDocument document, InputStream contentStream, String encoding) throws CoreException {
- Reader in= null;
- try {
-
- if (encoding == null)
- encoding= fManager.getDefaultEncoding();
-
- /*
- * XXX:
- * This is a workaround for a corresponding bug in Java readers and writer,
- * see: http://developer.java.sun.com/developer/bugParade/bugs/4508058.html
- * </p>
- */
- if (fHasBOM && CHARSET_UTF_8.equals(encoding))
- contentStream.read(new byte[IContentDescription.BOM_UTF_8.length]);
-
- in= new BufferedReader(new InputStreamReader(contentStream, encoding), BUFFER_SIZE);
- StringBuffer buffer= new StringBuffer(BUFFER_SIZE);
- char[] readBuffer= new char[READER_CHUNK_SIZE];
- int n= in.read(readBuffer);
- while (n > 0) {
- buffer.append(readBuffer, 0, n);
- n= in.read(readBuffer);
- }
-
- document.set(buffer.toString());
-
- } catch (IOException x) {
- String msg= x.getMessage() == null ? "" : x.getMessage(); //$NON-NLS-1$
- IStatus s= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, msg, x);
- throw new CoreException(s);
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException x) {
- }
- }
- }
- }
-
- /**
- * Checks whether the given file is synchronized with the the local file system.
- * If the file has been changed, a <code>CoreException</code> is thrown.
- *
- * @param file the file to check
- * @exception CoreException if file has been changed on the file system
- */
- private void checkSynchronizationState() throws CoreException {
- if (!isSynchronized()) {
- Status status= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IResourceStatus.OUT_OF_SYNC_LOCAL, FileBuffersMessages.getString("FileBuffer.error.outOfSync"), null); //$NON-NLS-1$
- throw new CoreException(status);
- }
- }
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java
deleted file mode 100644
index d8acbd112..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceFileBuffer.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filebuffers;
-
-import java.io.File;
-
-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.IWorkspace;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IPath;
-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.filebuffers.FileBuffers;
-
-
-public abstract class ResourceFileBuffer extends AbstractFileBuffer {
-
- /**
- * Runnable encapsulating an element state change. This runnable ensures
- * that a element change failed message is sent out to the element state
- * listeners in case an exception occurred.
- */
- private class SafeFileChange implements Runnable {
-
- /**
- * Creates a new safe runnable for the given file.
- */
- public SafeFileChange() {
- }
-
- /**
- * Execute the change.
- * Subclass responsibility.
- *
- * @exception an exception in case of error
- */
- protected void execute() throws Exception {
- }
-
- /**
- * Does everything necessary prior to execution.
- */
- public void preRun() {
- fManager.fireStateChanging(ResourceFileBuffer.this);
- }
-
- /*
- * @see java.lang.Runnable#run()
- */
- public void run() {
-
- if (isDisposed()) {
- fManager.fireStateChangeFailed(ResourceFileBuffer.this);
- return;
- }
-
- try {
- execute();
- } catch (Exception x) {
- FileBuffersPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, "Exception when synchronizing", x)); //$NON-NLS-1$
- fManager.fireStateChangeFailed(ResourceFileBuffer.this);
- }
- }
- }
-
- /**
- * Synchronizes the document with external resource changes.
- */
- private class FileSynchronizer implements IResourceChangeListener, IResourceDeltaVisitor {
-
- /** A flag indicating whether this synchronizer is installed or not. */
- private boolean fIsInstalled= false;
-
- /**
- * Creates a new file synchronizer. Is not yet installed on a file.
- */
- public FileSynchronizer() {
- }
-
- /**
- * Installs the synchronizer on the file.
- */
- public void install() {
- fFile.getWorkspace().addResourceChangeListener(this);
- fIsInstalled= true;
- }
-
- /**
- * Uninstalls the synchronizer from the file.
- */
- public void uninstall() {
- fFile.getWorkspace().removeResourceChangeListener(this);
- fIsInstalled= false;
- }
-
- /*
- * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent)
- */
- public void resourceChanged(IResourceChangeEvent e) {
- IResourceDelta delta= e.getDelta();
- try {
- if (delta != null && fIsInstalled)
- delta.accept(this);
- } catch (CoreException x) {
- handleCoreException(x);
- }
- }
-
- /*
- * @see IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
- */
- public boolean visit(IResourceDelta delta) throws CoreException {
-
- if (delta != null && fFile.equals(delta.getResource())) {
-
- SafeFileChange fileChange= null;
-
- switch (delta.getKind()) {
- case IResourceDelta.CHANGED:
- if ((IResourceDelta.CONTENT & delta.getFlags()) != 0) {
- if (!isDisposed() && !fCanBeSaved && !isSynchronized()) {
- fileChange= new SafeFileChange() {
- protected void execute() throws Exception {
- handleFileContentChanged();
- }
- };
- }
- }
- break;
- case IResourceDelta.REMOVED:
- if ((IResourceDelta.MOVED_TO & delta.getFlags()) != 0) {
- final IPath path= delta.getMovedToPath();
- fileChange= new SafeFileChange() {
- protected void execute() throws Exception {
- handleFileMoved(path);
- }
- };
- } else {
- if (!isDisposed() && !fCanBeSaved) {
- fileChange= new SafeFileChange() {
- protected void execute() throws Exception {
- handleFileDeleted();
- }
- };
- }
- }
- break;
- }
-
- if (fileChange != null) {
- fileChange.preRun();
- fManager.execute(fileChange, fSynchronizationContextCount > 0);
- }
- }
-
- return true; // because we are sitting on files anyway
- }
- }
-
-
-
- /** The location */
- protected IPath fLocation;
- /** The element for which the info is stored */
- protected IFile fFile;
- /** How often the element has been connected */
- protected int fReferenceCount;
- /** Can the element be saved */
- protected boolean fCanBeSaved= false;
- /** Has element state been validated */
- protected boolean fIsStateValidated= false;
- /** The status of this element */
- protected IStatus fStatus;
- /** The file synchronizer. */
- protected FileSynchronizer fFileSynchronizer;
- /** The time stamp at which this buffer synchronized with the underlying file. */
- protected long fSynchronizationStamp= IFile.NULL_STAMP;
- /** How often the synchronization context has been requested */
- protected int fSynchronizationContextCount;
- /** The text file buffer manager */
- protected TextFileBufferManager fManager;
-
-
-
-
- public ResourceFileBuffer(TextFileBufferManager manager) {
- super();
- fManager= manager;
- }
-
- abstract protected void handleFileContentChanged();
-
- abstract protected void addFileBufferContentListeners();
-
- abstract protected void removeFileBufferContentListeners();
-
- abstract protected void initializeFileBufferContent(IProgressMonitor monitor) throws CoreException;
-
- abstract protected void commitFileBufferContent(IProgressMonitor monitor, boolean overwrite) throws CoreException;
-
- public void create(IPath location, IProgressMonitor monitor) throws CoreException {
- IFile file= FileBuffers.getWorkspaceFileAtLocation(location);
- if (file == null || !file.exists())
- throw new CoreException(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getString("FileBuffer.error.fileDoesNotExist"), null)); //$NON-NLS-1$
-
- fLocation= location;
- fFile= file;
- fFileSynchronizer= new FileSynchronizer();
-
- refreshFile(monitor);
- initializeFileBufferContent(monitor);
- fSynchronizationStamp= fFile.getModificationStamp();
-
- addFileBufferContentListeners();
- }
-
- public void connect() {
- ++ fReferenceCount;
- if (fReferenceCount == 1)
- connected();
- }
-
- /**
- * Called when this file buffer has been connected. This is the case when
- * there is exactly one connection.
- * <p>
- * Clients may extend this method.
- */
- protected void connected() {
- fFileSynchronizer.install();
- }
-
- public void disconnect() throws CoreException {
- -- fReferenceCount;
- if (fReferenceCount == 0)
- disconnected();
- }
-
- /**
- * Called when this file buffer has been disconnected. This is the case when
- * the number of connections drops to <code>0</code>.
- * <p>
- * Clients may extend this method.
- */
- protected void disconnected() {
- if (fFileSynchronizer != null)
- fFileSynchronizer.uninstall();
- fFileSynchronizer= null;
- }
-
- /**
- * Returns whether this file buffer has already been disposed.
- *
- * @return <code>true</code> if already disposed, <code>false</code> otherwise
- */
- public boolean isDisposed() {
- return fFileSynchronizer == null;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#getLocation()
- */
- public IPath getLocation() {
- return fLocation;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#commit(org.eclipse.core.runtime.IProgressMonitor, boolean)
- */
- public void commit(IProgressMonitor monitor, boolean overwrite) throws CoreException {
- if (!isDisposed() && fCanBeSaved) {
-
- fManager.fireStateChanging(this);
-
- try {
- commitFileBufferContent(monitor, overwrite);
- } catch (CoreException x) {
- fManager.fireStateChangeFailed(this);
- throw x;
- } catch (RuntimeException x) {
- fManager.fireStateChangeFailed(this);
- throw x;
- }
-
- fCanBeSaved= false;
- addFileBufferContentListeners();
- fManager.fireDirtyStateChanged(this, fCanBeSaved);
- }
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#isDirty()
- */
- public boolean isDirty() {
- return fCanBeSaved;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#isShared()
- */
- public boolean isShared() {
- return fReferenceCount > 1;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#validateState(org.eclipse.core.runtime.IProgressMonitor, java.lang.Object)
- */
- public void validateState(IProgressMonitor monitor, Object computationContext) throws CoreException {
- if (!isDisposed() && !fIsStateValidated) {
-
- if (fFile.isReadOnly()) {
- IWorkspace workspace= fFile.getWorkspace();
- fStatus= workspace.validateEdit(new IFile[] { fFile }, computationContext);
- if (fStatus.isOK())
- handleFileContentChanged();
- }
- fIsStateValidated= true;
- fManager.fireStateValidationChanged(this, fIsStateValidated);
- }
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#isStateValidated()
- */
- public boolean isStateValidated() {
- return fIsStateValidated;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#resetStateValidation()
- */
- public void resetStateValidation() {
- if (fIsStateValidated) {
- fIsStateValidated= false;
- fManager.fireStateValidationChanged(this, fIsStateValidated);
- }
- }
-
- /**
- * Sends out the notification that the file serving as document input has been moved.
- *
- * @param newLocation the path of the new location of the file
- */
- protected void handleFileMoved(IPath newLocation) {
- fManager.fireUnderlyingFileMoved(this, newLocation);
- }
-
- /**
- * Sends out the notification that the file serving as document input has been deleted.
- */
- protected void handleFileDeleted() {
- fManager.fireUnderlyingFileDeleted(this);
- }
-
- /**
- * Refreshes the given file.
- */
- protected void refreshFile(IProgressMonitor monitor) {
- try {
- fFile.refreshLocal(IFile.DEPTH_INFINITE, monitor);
- } catch (OperationCanceledException x) {
- } catch (CoreException x) {
- handleCoreException(x);
- }
- }
-
- /**
- * Defines the standard procedure to handle <code>CoreExceptions</code>. Exceptions
- * are written to the plug-in log.
- *
- * @param exception the exception to be logged
- * @param message the message to be logged
- */
- protected void handleCoreException(CoreException exception) {
- ILog log= FileBuffersPlugin.getDefault().getLog();
- log.log(exception.getStatus());
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#isSynchronized()
- */
- public boolean isSynchronized() {
- return fSynchronizationStamp == fFile.getModificationStamp() && fFile.isSynchronized(IResource.DEPTH_ZERO);
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#getModificationStamp()
- */
- public long getModificationStamp() {
- File file= FileBuffers.getSystemFileAtLocation(getLocation());
- if (file != null)
- return file.lastModified();
- return IResource.NULL_STAMP;
- }
-
- /**
- * Requests the file buffer manager's synchronization context for this file buffer.
- */
- public void requestSynchronizationContext() {
- ++ fSynchronizationContextCount;
- }
-
- /**
- * Releases the file buffer manager's synchronization context for this file buffer.
- */
- public void releaseSynchronizationContext() {
- -- fSynchronizationContextCount;
- }
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java
deleted file mode 100644
index c1d7612ac..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/ResourceTextFileBuffer.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filebuffers;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResourceStatus;
-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.QualifiedName;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.core.runtime.content.IContentDescription;
-
-import org.eclipse.core.filebuffers.IPersistableAnnotationModel;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-/**
- * @since 3.0
- */
-public class ResourceTextFileBuffer extends ResourceFileBuffer implements ITextFileBuffer {
-
-
- private class DocumentListener implements IDocumentListener {
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent event) {
- fCanBeSaved= true;
- removeFileBufferContentListeners();
- fManager.fireDirtyStateChanged(ResourceTextFileBuffer.this, fCanBeSaved);
- }
- }
-
- /**
- * Reader chunk size.
- */
- static final private int READER_CHUNK_SIZE= 2048;
- /**
- * Buffer size.
- */
- static final private int BUFFER_SIZE= 8 * READER_CHUNK_SIZE;
- /**
- * Qualified name for the encoding key.
- */
- static final private QualifiedName ENCODING_KEY= new QualifiedName(FileBuffersPlugin.PLUGIN_ID, "encoding"); //$NON-NLS-1$
- /**
- * Constant for representing the OK status. This is considered a value object.
- */
- static final private IStatus STATUS_OK= new Status(IStatus.OK, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getString("FileBuffer.status.ok"), null); //$NON-NLS-1$
- /**
- * Constant for representing the error status. This is considered a value object.
- */
- static final private IStatus STATUS_ERROR= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.INFO, FileBuffersMessages.getString("FileBuffer.status.error"), null); //$NON-NLS-1$
- /**
- * Constant denoting UTF-8 encoding.
- */
- private static final String CHARSET_UTF_8= "UTF-8"; //$NON-NLS-1$
-
-
- /** The element's document */
- protected IDocument fDocument;
- /** The encoding used to create the document from the storage or <code>null</code> for workbench encoding. */
- protected String fEncoding;
- /** Internal document listener */
- protected IDocumentListener fDocumentListener= new DocumentListener();
- /** The element's annotation model */
- protected IAnnotationModel fAnnotationModel;
- /**
- * The encoding which has explicitly been set on the file.
- */
- private String fExplicitEncoding;
- /**
- * Tells whether the file on disk has a BOM.
- */
- private boolean fHasBOM;
-
-
- public ResourceTextFileBuffer(TextFileBufferManager manager) {
- super(manager);
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedTextFile#getDocument()
- */
- public IDocument getDocument() {
- return fDocument;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.ITextFileBuffer#getAnnotationModel()
- */
- public IAnnotationModel getAnnotationModel() {
- return fAnnotationModel;
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedTextFile#getEncoding()
- */
- public String getEncoding() {
- return fEncoding;
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedTextFile#setEncoding(java.lang.String)
- */
- public void setEncoding(String encoding) {
- fEncoding= encoding;
- fExplicitEncoding= encoding;
- fHasBOM= false;
- try {
- fFile.setCharset(encoding);
- if (encoding == null)
- fEncoding= fFile.getCharset();
- setHasBOM();
- } catch (CoreException x) {
- handleCoreException(x);
- }
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFile#getStatus()
- */
- public IStatus getStatus() {
- if (!isDisposed()) {
- if (fStatus != null)
- return fStatus;
- return (fDocument == null ? STATUS_ERROR : STATUS_OK);
- }
- return STATUS_ERROR;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBuffer#revert(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void revert(IProgressMonitor monitor) throws CoreException {
- if (isDisposed())
- return;
-
- refreshFile(monitor);
-
- IDocument original= null;
- IStatus status= null;
-
- try {
- original= fManager.createEmptyDocument(fFile.getLocation());
- setDocumentContent(original, fFile.getContents(), fEncoding);
- } catch (CoreException x) {
- status= x.getStatus();
- }
-
- fStatus= status;
-
- if (original != null) {
-
- String originalContents= original.get();
- boolean replaceContents= !originalContents.equals(fDocument.get());
-
- if (replaceContents) {
- fManager.fireBufferContentAboutToBeReplaced(this);
- fDocument.set(original.get());
- }
-
- if (fCanBeSaved) {
- fCanBeSaved= false;
- addFileBufferContentListeners();
- }
-
- if (replaceContents)
- fManager.fireBufferContentReplaced(this);
-
- if (fAnnotationModel instanceof IPersistableAnnotationModel) {
- IPersistableAnnotationModel persistableModel= (IPersistableAnnotationModel) fAnnotationModel;
- persistableModel.revert(fDocument);
- }
-
- fManager.fireDirtyStateChanged(this, fCanBeSaved);
- }
- }
-
- /*
- * @see org.eclipse.core.internal.filebuffers.FileBuffer#addFileBufferContentListeners()
- */
- protected void addFileBufferContentListeners() {
- if (fDocument != null)
- fDocument.addDocumentListener(fDocumentListener);
- }
-
- /*
- * @see org.eclipse.core.internal.filebuffers.FileBuffer#removeFileBufferContentListeners()
- */
- protected void removeFileBufferContentListeners() {
- if (fDocument != null)
- fDocument.removeDocumentListener(fDocumentListener);
- }
-
- /*
- * @see org.eclipse.core.internal.filebuffers.FileBuffer#initializeFileBufferContent(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void initializeFileBufferContent(IProgressMonitor monitor) throws CoreException {
- try {
- fEncoding= null;
- fExplicitEncoding= null;
- try {
- fEncoding= fFile.getPersistentProperty(ENCODING_KEY);
- } catch (CoreException x) {
- // we ignore exceptions here because we support the ENCODING_KEY property only for compatibility reasons
- }
- if (fEncoding != null) {
- // if we found an old encoding property, we try to migrate it to the new core.resources encoding support
- try {
- fExplicitEncoding= fEncoding;
- fFile.setCharset(fEncoding);
- // if successful delete old property
- fFile.setPersistentProperty(ENCODING_KEY, null);
- } catch (CoreException ex) {
- // log problem because we could not migrate the property successfully
- handleCoreException(ex);
- }
- } else {
- fExplicitEncoding= fFile.getCharset(false);
- if (fExplicitEncoding != null)
- fEncoding= fExplicitEncoding;
- else
- fEncoding= fFile.getCharset();
- }
-
- setHasBOM();
-
- fDocument= fManager.createEmptyDocument(fFile.getLocation());
- setDocumentContent(fDocument, fFile.getContents(), fEncoding);
-
- fAnnotationModel= fManager.createAnnotationModel(fFile.getLocation());
-
- } catch (CoreException x) {
- fDocument= fManager.createEmptyDocument(fFile.getLocation());
- fStatus= x.getStatus();
- }
- }
-
- /**
- * Sets whether the underlying file has a BOM.
- *
- * @throws CoreException if reading of file's content description fails
- */
- protected void setHasBOM() throws CoreException {
- fHasBOM= false;
- IContentDescription description= fFile.getContentDescription();
- fHasBOM= description != null && description.getProperty(IContentDescription.BYTE_ORDER_MARK) != null;
- }
-
- /*
- * @see org.eclipse.core.internal.filebuffers.ResourceFileBuffer#connected()
- */
- protected void connected() {
- super.connected();
- if (fAnnotationModel != null)
- fAnnotationModel.connect(fDocument);
- }
-
- /*
- * @see org.eclipse.core.internal.filebuffers.ResourceFileBuffer#disconnected()
- */
- protected void disconnected() {
- if (fAnnotationModel != null)
- fAnnotationModel.disconnect(fDocument);
- super.disconnected();
- }
-
- /*
- * @see org.eclipse.core.internal.filebuffers.FileBuffer#commitFileBufferContent(org.eclipse.core.runtime.IProgressMonitor, boolean)
- */
- protected void commitFileBufferContent(IProgressMonitor monitor, boolean overwrite) throws CoreException {
- String encoding= computeEncoding();
- try {
-
- byte[] bytes= fDocument.get().getBytes(encoding);
-
- /*
- * XXX:
- * This is a workaround for a corresponding bug in Java readers and writer,
- * see: http://developer.java.sun.com/developer/bugParade/bugs/4508058.html
- */
- if (fHasBOM && CHARSET_UTF_8.equals(encoding)) {
- int bomLength= IContentDescription.BOM_UTF_8.length;
- byte[] bytesWithBOM= new byte[bytes.length + bomLength];
- System.arraycopy(IContentDescription.BOM_UTF_8, 0, bytesWithBOM, 0, bomLength);
- System.arraycopy(bytes, 0, bytesWithBOM, bomLength, bytes.length);
- bytes= bytesWithBOM;
- }
-
- InputStream stream= new ByteArrayInputStream(bytes);
- if (fFile.exists()) {
-
- if (!overwrite)
- checkSynchronizationState();
-
-
- // here the file synchronizer should actually be removed and afterwards added again. However,
- // we are already inside an operation, so the delta is sent AFTER we have added the listener
- fFile.setContents(stream, overwrite, true, monitor);
- // set synchronization stamp to know whether the file synchronizer must become active
- fSynchronizationStamp= fFile.getModificationStamp();
-
- if (fAnnotationModel instanceof IPersistableAnnotationModel) {
- IPersistableAnnotationModel persistableModel= (IPersistableAnnotationModel) fAnnotationModel;
- persistableModel.commit(fDocument);
- }
-
- } else {
-
- try {
- monitor.beginTask("Saving", 2000); //$NON-NLS-1$
- ContainerGenerator generator = new ContainerGenerator(fFile.getWorkspace(), fFile.getParent().getFullPath());
- generator.generateContainer(new SubProgressMonitor(monitor, 1000));
- fFile.create(stream, false, new SubProgressMonitor(monitor, 1000));
- }
- finally {
- monitor.done();
- }
- }
-
- } catch (UnsupportedEncodingException x) {
- String message= FileBuffersMessages.getFormattedString("ResourceTextFileBuffer.error.unsupported_encoding.message_arg", encoding); //$NON-NLS-1$
- IStatus s= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, message, x);
- throw new CoreException(s);
- }
- }
-
- private String computeEncoding() {
- // User-defined encoding has first priority
- if (fExplicitEncoding != null)
- return fExplicitEncoding;
- try {
- /*
- * FIXME
- * Check whether explicit encoding has been set via properties dialog.
- * This is needed because no notification is sent when this property
- * changes, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=64077
- */
- fExplicitEncoding= fFile.getCharset(false);
- if (fExplicitEncoding != null)
- return fExplicitEncoding;
- } catch (CoreException e) {
- }
-
- // Probe content
- Reader reader= new BufferedReader(new StringReader(fDocument.get()));
- try {
- QualifiedName[] options= new QualifiedName[] { IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK };
- IContentDescription description= Platform.getContentTypeManager().getDescriptionFor(reader, fFile.getName(), options);
- if (description != null) {
- String encoding= description.getCharset();
- if (encoding != null)
- return encoding;
- }
- } catch (IOException ex) {
- // try next strategy
- } finally {
- try {
- reader.close();
- } catch (IOException ex) {
- FileBuffersPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, FileBuffersMessages.getString("ResourceTextFileBuffer.error.closeReader"), ex)); //$NON-NLS-1$
- }
- }
-
- // Use file's encoding if the file has a BOM
- if (fHasBOM)
- return fEncoding;
-
- // Use parent chain
- try {
- return fFile.getParent().getDefaultCharset();
- } catch (CoreException ex) {
- // Use global default
- return fManager.getDefaultEncoding();
- }
- }
-
- /**
- * Updates the element info to a change of the file content and sends out appropriate notifications.
- */
- protected void handleFileContentChanged() {
- if (isDisposed())
- return;
-
- IDocument document= fManager.createEmptyDocument(fFile.getLocation());
- IStatus status= null;
-
- try {
- setDocumentContent(document, fFile.getContents(false), fEncoding);
- } catch (CoreException x) {
- status= x.getStatus();
- }
-
- String newContent= document.get();
-
- if ( !newContent.equals(fDocument.get())) {
-
- fManager.fireBufferContentAboutToBeReplaced(this);
-
- removeFileBufferContentListeners();
- fDocument.set(newContent);
- fCanBeSaved= false;
- fSynchronizationStamp= fFile.getModificationStamp();
- fStatus= status;
- addFileBufferContentListeners();
-
- fManager.fireBufferContentReplaced(this);
-
- if (fAnnotationModel instanceof IPersistableAnnotationModel) {
- IPersistableAnnotationModel persistableModel= (IPersistableAnnotationModel) fAnnotationModel;
- try {
- persistableModel.reinitialize(fDocument);
- } catch (CoreException x) {
- fStatus= status;
- }
- }
-
- } else {
-
- removeFileBufferContentListeners();
- fCanBeSaved= false;
- fSynchronizationStamp= fFile.getModificationStamp();
- fStatus= status;
- addFileBufferContentListeners();
-
- fManager.fireDirtyStateChanged(this, fCanBeSaved);
- }
- }
-
- /**
- * Intitializes the given document with the given stream using the given encoding.
- *
- * @param document the document to be initialized
- * @param contentStream the stream which delivers the document content
- * @param encoding the character encoding for reading the given stream
- * @exception CoreException if the given stream can not be read
- */
- private void setDocumentContent(IDocument document, InputStream contentStream, String encoding) throws CoreException {
- Reader in= null;
- try {
-
- if (encoding == null)
- encoding= fManager.getDefaultEncoding();
-
- /*
- * XXX:
- * This is a workaround for a corresponding bug in Java readers and writer,
- * see: http://developer.java.sun.com/developer/bugParade/bugs/4508058.html
- */
- if (fHasBOM && CHARSET_UTF_8.equals(encoding))
- contentStream.read(new byte[IContentDescription.BOM_UTF_8.length]);
-
- in= new BufferedReader(new InputStreamReader(contentStream, encoding), BUFFER_SIZE);
- StringBuffer buffer= new StringBuffer(BUFFER_SIZE);
- char[] readBuffer= new char[READER_CHUNK_SIZE];
- int n= in.read(readBuffer);
- while (n > 0) {
- buffer.append(readBuffer, 0, n);
- n= in.read(readBuffer);
- }
-
- document.set(buffer.toString());
-
- } catch (IOException x) {
- String message= (x.getMessage() != null ? x.getMessage() : ""); //$NON-NLS-1$
- IStatus s= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, message, x);
- throw new CoreException(s);
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException x) {
- }
- }
- }
- }
-
- /**
- * Checks whether the given file is synchronized with the the local file system.
- * If the file has been changed, a <code>CoreException</code> is thrown.
- *
- * @param file the file to check
- * @exception CoreException if file has been changed on the file system
- */
- private void checkSynchronizationState() throws CoreException {
- if (!fFile.isSynchronized(IFile.DEPTH_ZERO)) {
- Status status= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IResourceStatus.OUT_OF_SYNC_LOCAL, FileBuffersMessages.getString("FileBuffer.error.outOfSync"), null); //$NON-NLS-1$
- throw new CoreException(status);
- }
- }
-}
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
deleted file mode 100644
index c179f1028..000000000
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/TextFileBufferManager.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.core.internal.filebuffers;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-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.Status;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.IAnnotationModelFactory;
-import org.eclipse.core.filebuffers.IDocumentFactory;
-import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
-import org.eclipse.core.filebuffers.IFileBuffer;
-import org.eclipse.core.filebuffers.IFileBufferListener;
-import org.eclipse.core.filebuffers.ISynchronizationContext;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-/**
- * @since 3.0
- */
-public class TextFileBufferManager implements ITextFileBufferManager {
-
- private Map fFilesBuffers= new HashMap();
- private List fFileBufferListeners= new ArrayList();
- private ExtensionsRegistry fRegistry;
- private ISynchronizationContext fSynchronizationContext;
-
-
- public TextFileBufferManager() {
- fRegistry= new ExtensionsRegistry();
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferManager#connect(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor)
- */
- public void connect(IPath location, IProgressMonitor monitor) throws CoreException {
- Assert.isNotNull(location);
- location= FileBuffers.normalizeLocation(location);
-
- AbstractFileBuffer fileBuffer= (AbstractFileBuffer) fFilesBuffers.get(location);
- if (fileBuffer == null) {
-
- fileBuffer= createFileBuffer(location);
- if (fileBuffer == null)
- throw new CoreException(new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, 0, FileBuffersMessages.getString("FileBufferManager.error.canNotCreateFilebuffer"), null)); //$NON-NLS-1$
-
- fileBuffer.create(location, monitor);
- fileBuffer.connect();
- fFilesBuffers.put(location, fileBuffer);
- fireBufferCreated(fileBuffer);
-
- } else {
- fileBuffer.connect();
- }
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferManager#disconnect(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IProgressMonitor)
- */
- public void disconnect(IPath location, IProgressMonitor monitor) throws CoreException {
- Assert.isNotNull(location);
- location= FileBuffers.normalizeLocation(location);
-
- AbstractFileBuffer fileBuffer= (AbstractFileBuffer) fFilesBuffers.get(location);
- if (fileBuffer != null) {
- fileBuffer.disconnect();
- if (fileBuffer.isDisposed()) {
- fFilesBuffers.remove(location);
- fireBufferDisposed(fileBuffer);
- }
- }
- }
-
- private AbstractFileBuffer createFileBuffer(IPath location) {
- if (!isTextFile(location))
- return null;
-
- if (isWorkspaceResource(location))
- return new ResourceTextFileBuffer(this);
-
- return new JavaTextFileBuffer(this);
- }
-
- private boolean isWorkspaceResource(IPath location) {
- return FileBuffers.getWorkspaceFileAtLocation(location) != null;
- }
-
- private boolean isTextFile(IPath location) {
- return true;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferManager#getFileBuffer(org.eclipse.core.runtime.IPath)
- */
- public IFileBuffer getFileBuffer(IPath location) {
- location= FileBuffers.normalizeLocation(location);
- return (IFileBuffer) fFilesBuffers.get(location);
- }
-
- /*
- * @see org.eclipse.core.filebuffers.ITextFileBufferManager#getTextFileBuffer(org.eclipse.core.runtime.IPath)
- */
- public ITextFileBuffer getTextFileBuffer(IPath location) {
- location= FileBuffers.normalizeLocation(location);
- return (ITextFileBuffer) fFilesBuffers.get(location);
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFileManager#getDefaultEncoding()
- */
- public String getDefaultEncoding() {
- return ResourcesPlugin.getEncoding();
- }
-
- /*
- * @see org.eclipse.core.filebuffers.ITextFileBufferManager#createEmptyDocument(org.eclipse.core.runtime.IPath)
- */
- public IDocument createEmptyDocument(IPath location) {
- Assert.isNotNull(location);
- location= FileBuffers.normalizeLocation(location);
-
- IDocumentFactory factory= fRegistry.getDocumentFactory(location);
-
- IDocument document= null;
- if (factory != null)
- document= factory.createDocument();
- else
- document= new Document();
-
- IDocumentSetupParticipant[] participants= fRegistry.getDocumentSetupParticipants(location);
- if (participants != null) {
- for (int i= 0; i < participants.length; i++)
- participants[i].setup(document);
- }
-
- return document;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.ITextFileBufferManager#createAnnotationModel(org.eclipse.core.runtime.IPath)
- */
- public IAnnotationModel createAnnotationModel(IPath location) {
- Assert.isNotNull(location);
- location= FileBuffers.normalizeLocation(location);
- IAnnotationModelFactory factory= fRegistry.getAnnotationModelFactory(location);
- if (factory != null)
- return factory.createAnnotationModel(location);
- return null;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferManager#addFileBufferListener(org.eclipse.core.filebuffers.IFileBufferListener)
- */
- public void addFileBufferListener(IFileBufferListener listener) {
- Assert.isNotNull(listener);
- if (!fFileBufferListeners.contains(listener))
- fFileBufferListeners.add(listener);
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferManager#removeFileBufferListener(org.eclipse.core.filebuffers.IFileBufferListener)
- */
- public void removeFileBufferListener(IFileBufferListener listener) {
- Assert.isNotNull(listener);
- fFileBufferListeners.remove(listener);
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferManager#setSynchronizationContext(org.eclipse.core.filebuffers.ISynchronizationContext)
- */
- public void setSynchronizationContext(ISynchronizationContext context) {
- fSynchronizationContext= context;
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferManager#requestSynchronizationContext(org.eclipse.core.runtime.IPath)
- */
- public void requestSynchronizationContext(IPath location) {
- Assert.isNotNull(location);
- location= FileBuffers.normalizeLocation(location);
-
- AbstractFileBuffer fileBuffer= (AbstractFileBuffer) fFilesBuffers.get(location);
- if (fileBuffer != null)
- fileBuffer.requestSynchronizationContext();
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferManager#releaseSynchronizationContext(org.eclipse.core.runtime.IPath)
- */
- public void releaseSynchronizationContext(IPath location) {
- Assert.isNotNull(location);
- location= FileBuffers.normalizeLocation(location);
-
- AbstractFileBuffer fileBuffer= (AbstractFileBuffer) fFilesBuffers.get(location);
- if (fileBuffer != null)
- fileBuffer.releaseSynchronizationContext();
- }
-
- /**
- * Executes the given runnable in the synchronization context of this file buffer manager.
- * If there is no synchronization context connected with this manager, the runnable is
- * directly executed.
- *
- * @param runnable the runnable to be executed
- */
- public void execute(Runnable runnable, boolean requestSynchronizationContext) {
- if (requestSynchronizationContext && fSynchronizationContext != null)
- fSynchronizationContext.run(runnable);
- else
- runnable.run();
- }
-
- protected void fireDirtyStateChanged(IFileBuffer buffer, boolean isDirty) {
- Iterator e= new ArrayList(fFileBufferListeners).iterator();
- while (e.hasNext()) {
- IFileBufferListener l= (IFileBufferListener) e.next();
- l.dirtyStateChanged(buffer, isDirty);
- }
- }
-
- protected void fireBufferContentAboutToBeReplaced(IFileBuffer buffer) {
- Iterator e= new ArrayList(fFileBufferListeners).iterator();
- while (e.hasNext()) {
- IFileBufferListener l= (IFileBufferListener) e.next();
- l.bufferContentAboutToBeReplaced(buffer);
- }
- }
-
- protected void fireBufferContentReplaced(IFileBuffer buffer) {
- Iterator e= new ArrayList(fFileBufferListeners).iterator();
- while (e.hasNext()) {
- IFileBufferListener l= (IFileBufferListener) e.next();
- l.bufferContentReplaced(buffer);
- }
- }
-
- protected void fireUnderlyingFileMoved(IFileBuffer buffer, IPath target) {
- Iterator e= new ArrayList(fFileBufferListeners).iterator();
- while (e.hasNext()) {
- IFileBufferListener l= (IFileBufferListener) e.next();
- l.underlyingFileMoved(buffer, target);
- }
- }
-
- protected void fireUnderlyingFileDeleted(IFileBuffer buffer) {
- Iterator e= new ArrayList(fFileBufferListeners).iterator();
- while (e.hasNext()) {
- IFileBufferListener l= (IFileBufferListener) e.next();
- l.underlyingFileDeleted(buffer);
- }
- }
-
- protected void fireStateValidationChanged(IFileBuffer buffer, boolean isStateValidated) {
- Iterator e= new ArrayList(fFileBufferListeners).iterator();
- while (e.hasNext()) {
- IFileBufferListener l= (IFileBufferListener) e.next();
- l.stateValidationChanged(buffer, isStateValidated);
- }
- }
-
- protected void fireStateChanging(IFileBuffer buffer) {
- Iterator e= new ArrayList(fFileBufferListeners).iterator();
- while (e.hasNext()) {
- IFileBufferListener l= (IFileBufferListener) e.next();
- l.stateChanging(buffer);
- }
- }
-
- protected void fireStateChangeFailed(IFileBuffer buffer) {
- Iterator e= new ArrayList(fFileBufferListeners).iterator();
- while (e.hasNext()) {
- IFileBufferListener l= (IFileBufferListener) e.next();
- l.stateChangeFailed(buffer);
- }
- }
-
- protected void fireBufferCreated(IFileBuffer buffer) {
- Iterator e= new ArrayList(fFileBufferListeners).iterator();
- while (e.hasNext()) {
- IFileBufferListener l= (IFileBufferListener) e.next();
- l.bufferCreated(buffer);
- }
- }
-
- protected void fireBufferDisposed(IFileBuffer buffer) {
- Iterator e= new ArrayList(fFileBufferListeners).iterator();
- while (e.hasNext()) {
- IFileBufferListener l= (IFileBufferListener) e.next();
- l.bufferDisposed(buffer);
- }
- }
-}
diff --git a/org.eclipse.jface.text/.classpath b/org.eclipse.jface.text/.classpath
deleted file mode 100644
index f2a7ad8ee..000000000
--- a/org.eclipse.jface.text/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="projection"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.eclipse.jface.text/.cvsignore b/org.eclipse.jface.text/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/org.eclipse.jface.text/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/org.eclipse.jface.text/.options b/org.eclipse.jface.text/.options
deleted file mode 100644
index 667d1d1c9..000000000
--- a/org.eclipse.jface.text/.options
+++ /dev/null
@@ -1,7 +0,0 @@
-# Debugging options for the org.eclipse.jface.text plug-in
-
-# Prints debug information related to AnnotationPainter
-org.eclipse.jface.text/debug/AnnotationPainter= false
-
-# Prints debug information related to AbstractContentAssistSubjectAdapter and its subclasses
-org.eclipse.jface.text/debug/ContentAssistSubjectAdapters= false \ No newline at end of file
diff --git a/org.eclipse.jface.text/.project b/org.eclipse.jface.text/.project
deleted file mode 100644
index 4c2048403..000000000
--- a/org.eclipse.jface.text/.project
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jface.text</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.runtime.compatibility</project>
- <project>org.eclipse.jface</project>
- <project>org.eclipse.swt</project>
- <project>org.eclipse.text</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/org.eclipse.jface.text/about.html b/org.eclipse.jface.text/about.html
deleted file mode 100644
index 9db411aab..000000000
--- a/org.eclipse.jface.text/about.html
+++ /dev/null
@@ -1,30 +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>20th June, 2002</p>
-<h3>License</h3>
-<p>Eclipse.org 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
-Common Public License Version 1.0 (&quot;CPL&quot;). A copy of the CPL is available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>.
-For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL (&quot;Other License&quot;), any modifications, enhancements and/or
-other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/org.eclipse.jface.text/build.properties b/org.eclipse.jface.text/build.properties
deleted file mode 100644
index 9616ddc47..000000000
--- a/org.eclipse.jface.text/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-bin.includes = plugin.properties,\
- plugin.xml,\
- .options,\
- *.jar,\
- about.html
-source.jfacetext.jar = src/,\
- projection/
diff --git a/org.eclipse.jface.text/plugin.properties b/org.eclipse.jface.text/plugin.properties
deleted file mode 100644
index db3cdf485..000000000
--- a/org.eclipse.jface.text/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2004 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Common Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/cpl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-pluginName = JFace Text
-providerName = Eclipse.org
diff --git a/org.eclipse.jface.text/plugin.xml b/org.eclipse.jface.text/plugin.xml
deleted file mode 100644
index 971c4dd51..000000000
--- a/org.eclipse.jface.text/plugin.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.jface.text"
- name="%pluginName"
- version="3.0.0"
- provider-name="%providerName">
-
- <runtime>
- <library name="jfacetext.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.text" export="true"/>
- <import plugin="org.eclipse.swt"/>
- <import plugin="org.eclipse.jface"/>
- </requires>
-
-</plugin>
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/AnnotationBag.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/AnnotationBag.java
deleted file mode 100644
index c3ae97b7f..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/AnnotationBag.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.text.source.projection;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.jface.text.source.Annotation;
-
-/**
- * A bag of annotations.
- *
- * @since 3.0
- */
-public class AnnotationBag extends Annotation {
-
- private Set fAnnotations;
-
- /** Creates a new annotation bag.
- *
- * @param type the annotation type
- */
- public AnnotationBag(String type) {
- super(type, false, null);
- }
-
- public void add(Annotation annotation) {
- if (fAnnotations == null)
- fAnnotations= new HashSet(2);
- fAnnotations.add(annotation);
- }
-
- public void remove(Annotation annotation) {
- if (fAnnotations != null) {
- fAnnotations.remove(annotation);
- if (fAnnotations.isEmpty())
- fAnnotations= null;
- }
- }
-
- public boolean isEmpty() {
- return fAnnotations == null;
- }
-}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/IProjectionListener.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/IProjectionListener.java
deleted file mode 100644
index a13cc0f42..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/IProjectionListener.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.text.source.projection;
-
-/**
- * Internal class. Do not use.
- *
- * @since 3.0
- */
-public interface IProjectionListener {
-
- /**
- * Tells this listener that projection has been enabled.
- */
- void projectionEnabled();
-
- /**
- * Tells this listener that projection has been disabled.
- */
- void projectionDisabled();
-}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotation.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotation.java
deleted file mode 100644
index a413c59e7..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotation.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.text.source.projection;
-
-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.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationPresentation;
-import org.eclipse.jface.text.source.ImageUtilities;
-
-/**
- * Annotation used to represent the projection of a master document onto a
- * <code>ProjectionDocument</code>. A projection annotation can be either
- * expanded or collapsed. If expanded it corresponds to a segment of the
- * projection document. If collapsed, it represents a region of the master
- * document that does not have a corresponding segment in the projection
- * document.
- * <p>
- *
- * @since 3.0
- */
-public class ProjectionAnnotation extends Annotation implements IAnnotationPresentation {
-
- private static class DisplayDisposeRunnable implements Runnable {
-
- public void run() {
- if (fgCollapsedImage != null) {
- fgCollapsedImage.dispose();
- fgCollapsedImage= null;
- }
- if (fgExpandedImage != null) {
- fgExpandedImage.dispose();
- fgExpandedImage= null;
- }
- }
- }
-
- /**
- * The type of projection annotations.
- */
- public static final String TYPE= "org.eclipse.projection"; //$NON-NLS-1$
-
-
- private static final int COLOR= SWT.COLOR_DARK_GRAY;
- private static Image fgCollapsedImage;
- private static Image fgExpandedImage;
-
-
- /** The state of this annotation */
- private boolean fIsCollapsed= false;
- /** Indicates whether this annotation should be painted as range */
- private boolean fIsRangeIndication= false;
-
- /**
- * Creates a new projection annotation.
- */
- public ProjectionAnnotation() {
- this(false);
- }
-
- public ProjectionAnnotation(boolean isCollapsed) {
- super(TYPE, false, null);
- fIsCollapsed= isCollapsed;
- }
-
- public void setRangeIndication(boolean rangeIndication) {
- fIsRangeIndication= rangeIndication;
- }
-
- private void drawRangeIndication(GC gc, Canvas canvas, Rectangle r) {
- final int MARGIN= 3;
- Color fg= gc.getForeground();
- gc.setForeground(canvas.getDisplay().getSystemColor(COLOR));
-
- gc.setLineWidth(1);
- gc.drawLine(r.x + 4, r.y + 12, r.x + 4, r.y + r.height - MARGIN);
- gc.drawLine(r.x + 4, r.y + r.height - MARGIN, r.x + r.width - MARGIN, r.y + r.height - MARGIN);
- gc.setForeground(fg);
- }
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationPresentation#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) {
- Image image= getImage(canvas.getDisplay());
- if (image != null) {
- ImageUtilities.drawImage(image, gc, canvas, rectangle, SWT.CENTER, SWT.TOP);
- if (fIsRangeIndication)
- drawRangeIndication(gc, canvas, rectangle);
- }
- }
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationPresentation#getLayer()
- */
- public int getLayer() {
- return IAnnotationPresentation.DEFAULT_LAYER;
- }
-
- private Image getImage(Display display) {
- initializeImages(display);
- return isCollapsed() ? fgCollapsedImage : fgExpandedImage;
- }
-
- private void initializeImages(Display display) {
- if (fgCollapsedImage == null) {
-
- ImageDescriptor descriptor= ImageDescriptor.createFromFile(ProjectionAnnotation.class, "images/collapsed.gif"); //$NON-NLS-1$
- fgCollapsedImage= descriptor.createImage(display);
- descriptor= ImageDescriptor.createFromFile(ProjectionAnnotation.class, "images/expanded.gif"); //$NON-NLS-1$
- fgExpandedImage= descriptor.createImage(display);
-
- display.disposeExec(new DisplayDisposeRunnable());
- }
- }
-
- /**
- * Returns the state of this annotation.
- *
- * @return <code>true</code> if collapsed
- */
- public boolean isCollapsed() {
- return fIsCollapsed;
- }
-
- /**
- * Marks this annotation as being collapsed.
- */
- public void markCollapsed() {
- fIsCollapsed= true;
- }
-
- /**
- * Marks this annotation as being unfolded.
- */
- public void markExpanded() {
- fIsCollapsed= false;
- }
-}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationHover.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationHover.java
deleted file mode 100644
index b26321f73..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationHover.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.text.source.projection;
-
-import java.util.Iterator;
-
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.resource.JFaceResources;
-
-import org.eclipse.jface.text.BadLocationException;
-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.Position;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.IAnnotationHoverExtension;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
-import org.eclipse.jface.text.source.ILineRange;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.ISourceViewerExtension2;
-import org.eclipse.jface.text.source.LineRange;
-
-/**
- * Annotation hover for projection annotations.
- * <p>
- * Internal class. Do not use. Public for testing purposes only.
- *
- * @since 3.0
- */
-class ProjectionAnnotationHover implements IAnnotationHover, IAnnotationHoverExtension {
-
- private IInformationControlCreator fInformationControlCreator;
-
- /**
- * Sets the hover control creator for this projection annotation hover.
- *
- * @param creator the creator
- */
- public void setHoverControlCreator(IInformationControlCreator creator) {
- fInformationControlCreator= creator;
- }
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationHover#getHoverInfo(org.eclipse.jface.text.source.ISourceViewer, int)
- */
- public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
- // this is a no-op as semantics is defined by the implementation of the annotation hover extension
- return null;
- }
-
- private int compareRulerLine(Position position, IDocument document, int line) {
- if (position.getOffset() > -1 && position.getLength() > -1) {
- try {
- int startLine= document.getLineOfOffset(position.getOffset());
- if (line == startLine)
- return 1;
- if (startLine <= line && line <= document.getLineOfOffset(position.getOffset() + position.getLength()))
- return 2;
- } catch (BadLocationException x) {
- }
- }
- return 0;
- }
-
- private String getProjectionTextAtLine(ISourceViewer viewer, int line, int numberOfLines) {
-
- IAnnotationModel model= null;
- if (viewer instanceof ISourceViewerExtension2) {
- ISourceViewerExtension2 viewerExtension= (ISourceViewerExtension2) viewer;
- IAnnotationModel visual= viewerExtension.getVisualAnnotationModel();
- if (visual instanceof IAnnotationModelExtension) {
- IAnnotationModelExtension modelExtension= (IAnnotationModelExtension) visual;
- model= modelExtension.getAnnotationModel(ProjectionSupport.PROJECTION);
- }
- }
-
- if (model != null) {
- try {
- IDocument document= viewer.getDocument();
- Iterator e= model.getAnnotationIterator();
- while (e.hasNext()) {
- ProjectionAnnotation annotation= (ProjectionAnnotation) e.next();
- if (!annotation.isCollapsed())
- continue;
-
- Position position= model.getPosition(annotation);
- if (position == null)
- continue;
-
- if (1 == compareRulerLine(position, document, line))
- return getText(document, position.getOffset(), position.getLength(), numberOfLines);
-
- }
- } catch (BadLocationException x) {
- }
- }
-
- return null;
- }
-
- private String getText(IDocument document, int offset, int length, int numberOfLines) throws BadLocationException {
- int endOffset= offset + length;
-
- try {
- int endLine= document.getLineOfOffset(offset) + Math.max(0, numberOfLines -1);
- IRegion lineInfo= document.getLineInformation(endLine);
- endOffset= Math.min(endOffset, lineInfo.getOffset() + lineInfo.getLength());
- } catch (BadLocationException x) {
- }
-
- return document.get(offset, endOffset - offset);
- }
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationHoverExtension#getHoverInfo(org.eclipse.jface.text.source.ISourceViewer, org.eclipse.jface.text.source.ILineRange, int)
- */
- public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines) {
- return getProjectionTextAtLine(sourceViewer, lineRange.getStartLine(), visibleLines);
- }
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationHoverExtension#getHoverLineRange(org.eclipse.jface.text.source.ISourceViewer, int)
- */
- public ILineRange getHoverLineRange(ISourceViewer viewer, int lineNumber) {
- return new LineRange(lineNumber, 1);
- }
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationHoverExtension#canHandleMouseCursor()
- */
- public boolean canHandleMouseCursor() {
- return false;
- }
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationHoverExtension#getHoverControlCreator()
- */
- public IInformationControlCreator getHoverControlCreator() {
-
- if (fInformationControlCreator != null)
- return fInformationControlCreator;
-
- return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- return new SourceViewerInformationControl(parent, JFaceResources.TEXT_FONT);
- }
- };
- }
-}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationModel.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationModel.java
deleted file mode 100644
index a84eca1e2..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationModel.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.text.source.projection;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.AnnotationModel;
-
-
-/**
- * A projection annotation model.
- *
- * @since 3.0
- */
-public class ProjectionAnnotationModel extends AnnotationModel {
-
-
- public ProjectionAnnotationModel() {
- }
-
- /**
- * Changes the state of the given annotation to collapsed. An appropriate
- * annotation model change event is sent out.
- *
- * @param annotation the annotation
- */
- public void collapse(Annotation annotation) {
- if (annotation instanceof ProjectionAnnotation) {
- ProjectionAnnotation projection= (ProjectionAnnotation) annotation;
- if (!projection.isCollapsed()) {
- projection.markCollapsed();
- modifyAnnotation(projection, true);
- }
- }
- }
-
- /**
- * Changes the state of the given annotation to expanded. An appropriate
- * annotation model change event is sent out.
- *
- * @param annotation the annotation
- */
- public void expand(Annotation annotation) {
- if (annotation instanceof ProjectionAnnotation) {
- ProjectionAnnotation projection= (ProjectionAnnotation) annotation;
- if (projection.isCollapsed()) {
- projection.markExpanded();
- modifyAnnotation(projection, true);
- }
- }
- }
-
- /**
- * Toggles the expansion state of the given annotation. An appropriate
- * annotation model change event is sent out.
- *
- * @param annotation the annotation
- */
- public void toggleExpansionState(Annotation annotation) {
- if (annotation instanceof ProjectionAnnotation) {
- ProjectionAnnotation projection= (ProjectionAnnotation) annotation;
-
- if (projection.isCollapsed())
- projection.markExpanded();
- else
- projection.markCollapsed();
-
- modifyAnnotation(projection, true);
- }
- }
-
- /**
- * Expands all annotations that overlap with the given range and are collapsed.
- *
- * @param offset the range offset
- * @param length the range length
- * @return <code>true</code> if any annotation has been expanded, <code>false</code> otherwise
- */
- public boolean expandAll(int offset, int length) {
- return expandAll(offset, length, true);
- }
-
- /**
- * Expands all annotations that overlap with the given range and are collapsed. Fires a model change event if
- * requested.
- *
- * @param offset the offset of the range
- * @param length the length of the range
- * @param fireModelChanged <code>true</code> if a model change event
- * should be fired, <code>false</code> otherwise
- * @return <code>true</code> if any annotation has been expanded, <code>false</code> otherwise
- */
- protected boolean expandAll(int offset, int length, boolean fireModelChanged) {
-
- boolean expanding= false;
-
- Iterator iterator= getAnnotationIterator();
- while (iterator.hasNext()) {
- ProjectionAnnotation annotation= (ProjectionAnnotation) iterator.next();
- if (annotation.isCollapsed()) {
- Position position= getPosition(annotation);
- if (position != null && position.overlapsWith(offset, length) /* || is a delete at the boundary */ ) {
- annotation.markExpanded();
- modifyAnnotation(annotation, false);
- expanding= true;
- }
- }
- }
-
- if (expanding && fireModelChanged)
- fireModelChanged();
-
- return expanding;
- }
-
- /**
- * Modifies the annotation model.
- *
- * @param deletions the list of deleted annotations
- * @param additions the set of annotations to add together with their associated position
- * @param modifications the list of modified annotations
- */
- public void modifyAnnotations(Annotation[] deletions, Map additions, Annotation[] modifications) {
- try {
- replaceAnnotations(deletions, additions, false);
- if (modifications != null) {
- for (int i= 0; i < modifications.length; i++)
- modifyAnnotation(modifications[i], false);
- }
- } catch (BadLocationException x) {
- }
- fireModelChanged();
- }
-}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionRulerColumn.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionRulerColumn.java
deleted file mode 100644
index 0f151c807..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionRulerColumn.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.text.source.projection;
-
-
-import java.util.Iterator;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.AnnotationRulerColumn;
-import org.eclipse.jface.text.source.CompositeRuler;
-import org.eclipse.jface.text.source.IAnnotationAccess;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
-
-
-/**
- * A ruler column for controlling the behavior of a
- * <code>ProjectionSourceViewer</code>.
- * <p>
- * Internal class. Do not use. Public only for testing purposes.
- *
- * @since 3.0
- */
-class ProjectionRulerColumn extends AnnotationRulerColumn {
-
- private ProjectionAnnotation fCurrentAnnotation;
-
- /**
- * Creates a new projection ruler column.
- *
- * @param model the column's annotation model
- * @param width the width in pixels
- * @param annotationAccess the annotation access
- */
- public ProjectionRulerColumn(IAnnotationModel model, int width, IAnnotationAccess annotationAccess) {
- super(model, width, annotationAccess);
- }
-
- /**
- * Creates a new projection ruler column.
- *
- * @param width the width in pixels
- * @param annotationAccess the annotation access
- */
- public ProjectionRulerColumn(int width, IAnnotationAccess annotationAccess) {
- super(width, annotationAccess);
- }
-
- /*
- * @see org.eclipse.jface.text.source.AnnotationRulerColumn#mouseClicked(int)
- */
- protected void mouseClicked(int line) {
- clearCurrentAnnotation();
- ProjectionAnnotation annotation= findAnnotation(line, true);
- if (annotation != null) {
- ProjectionAnnotationModel model= (ProjectionAnnotationModel) getModel();
- model.toggleExpansionState(annotation);
- }
- }
-
- /**
- * Returns the projection annotation of the column's annotation
- * model that contains the given line.
- *
- * @param line the line
- * @return the projection annotation containing the given line
- */
- private ProjectionAnnotation findAnnotation(int line, boolean exact) {
-
- ProjectionAnnotation previousAnnotation= null;
-
- IAnnotationModel model= getModel();
- if (model != null) {
- IDocument document= getCachedTextViewer().getDocument();
-
- int previousDistance= Integer.MAX_VALUE;
-
- Iterator e= model.getAnnotationIterator();
- while (e.hasNext()) {
- Object next= e.next();
- if (next instanceof ProjectionAnnotation) {
- ProjectionAnnotation annotation= (ProjectionAnnotation) next;
- Position p= model.getPosition(annotation);
- if (p == null)
- continue;
-
- int distance= getDistance(p, document, line);
- if (distance == -1)
- continue;
-
- if (!exact) {
- if (distance < previousDistance) {
- previousAnnotation= annotation;
- previousDistance= distance;
- }
- } else if (distance == 0) {
- previousAnnotation= annotation;
- }
- }
- }
- }
-
- return previousAnnotation;
- }
-
- /**
- * Returns the distance of the given line to the the start line of the given position in the given document. The distance is
- * <code>-1</code> when the line is not included in the given position.
- *
- * @param position the position
- * @param document the document
- * @param line the line
- * @return <code>-1</code> if line is not contained, a position number otherwise
- */
- private int getDistance(Position position, IDocument document, int line) {
- if (position.getOffset() > -1 && position.getLength() > -1) {
- try {
- int startLine= document.getLineOfOffset(position.getOffset());
- int endLine= document.getLineOfOffset(position.getOffset() + position.getLength());
- if (startLine <= line && line < endLine)
- return line - startLine;
- } catch (BadLocationException x) {
- }
- }
- return -1;
- }
-
- private boolean clearCurrentAnnotation() {
- if (fCurrentAnnotation != null) {
- fCurrentAnnotation.setRangeIndication(false);
- fCurrentAnnotation= null;
- return true;
- }
- return false;
- }
-
- /*
- * @see org.eclipse.jface.text.source.IVerticalRulerColumn#createControl(org.eclipse.jface.text.source.CompositeRuler, org.eclipse.swt.widgets.Composite)
- */
- public Control createControl(CompositeRuler parentRuler, Composite parentControl) {
- Control control= super.createControl(parentRuler, parentControl);
-
- // set background
- Display display= parentControl.getDisplay();
- Color background= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
- control.setBackground(background);
-
- // install hover listener
- control.addMouseTrackListener(new MouseTrackAdapter() {
- public void mouseExit(MouseEvent e) {
- if (clearCurrentAnnotation())
- redraw();
- }
- });
-
- // install mouse move listener
- control.addMouseMoveListener(new MouseMoveListener() {
- public void mouseMove(MouseEvent e) {
- boolean redraw= false;
- ProjectionAnnotation annotation= findAnnotation(toDocumentLineNumber(e.y), false);
- if (annotation != fCurrentAnnotation) {
- if (fCurrentAnnotation != null) {
- fCurrentAnnotation.setRangeIndication(false);
- redraw= true;
- }
- fCurrentAnnotation= annotation;
- if (fCurrentAnnotation != null && !fCurrentAnnotation.isCollapsed()) {
- fCurrentAnnotation.setRangeIndication(true);
- redraw= true;
- }
- }
- if (redraw)
- redraw();
- }
- });
- return control;
- }
-
- /*
- * @see org.eclipse.jface.text.source.AnnotationRulerColumn#setModel(org.eclipse.jface.text.source.IAnnotationModel)
- */
- public void setModel(IAnnotationModel model) {
- if (model instanceof IAnnotationModelExtension) {
- IAnnotationModelExtension extension= (IAnnotationModelExtension) model;
- model= extension.getAnnotationModel(ProjectionSupport.PROJECTION);
- }
- super.setModel(model);
- }
-
- /*
- * @see org.eclipse.jface.text.source.AnnotationRulerColumn#isDelegatingToParentRuler()
- * @since 3.0
- */
- protected boolean isPropagatingMouseListener() {
- return false;
- }
-
- /*
- * @see org.eclipse.jface.text.source.AnnotationRulerColumn#hasLineAnnotations(int)
- * @since 3.0
- */
- protected boolean hasAnnotation(int lineNumber) {
- return findAnnotation(lineNumber, true) != null;
- }
-}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.java
deleted file mode 100644
index e1d35dea7..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSummary.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.text.source.projection;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-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.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ISynchronizable;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationAccess;
-import org.eclipse.jface.text.source.IAnnotationAccessExtension;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
-
-/**
- * Strategy for managing annotation summaries for collapsed ranges.
- *
- * @since 3.0
- */
-class ProjectionSummary {
-
- private class Summarizer extends Thread {
-
- private boolean fReset= true;
-
- public Summarizer(IProgressMonitor monitor) {
- fProgressMonitor= monitor;
- setDaemon(true);
- start();
- }
-
- public void reset() {
- fReset= true;
- }
-
- /*
- * @see java.lang.Thread#run()
- */
- public void run() {
- while (true) {
- synchronized (fLock) {
- if (!fReset)
- break;
- fReset= false;
- }
- internalUpdateSummaries(fProgressMonitor);
- }
-
- synchronized (fLock) {
- fSummarizer= null;
- }
- }
- }
-
-
- private ProjectionViewer fProjectionViewer;
- private IAnnotationModel fAnnotationModel;
- private IAnnotationAccess fAnnotationAccess;
- private List fConfiguredAnnotationTypes;
-
- private Object fLock= new Object();
- private IProgressMonitor fProgressMonitor;
- private volatile Summarizer fSummarizer;
-
-
- public ProjectionSummary(ProjectionViewer projectionViewer, IAnnotationAccess annotationAccess) {
- super();
- fProjectionViewer= projectionViewer;
- fAnnotationAccess= annotationAccess;
- }
-
- public void addAnnotationType(String annotationType) {
- synchronized(fLock) {
- if (fConfiguredAnnotationTypes == null) {
- fConfiguredAnnotationTypes= new ArrayList();
- fConfiguredAnnotationTypes.add(annotationType);
- } else if (!fConfiguredAnnotationTypes.contains(annotationType))
- fConfiguredAnnotationTypes.add(annotationType);
- }
- }
-
- public void removeAnnotationType(String annotationType) {
- synchronized (fLock) {
- if (fConfiguredAnnotationTypes != null) {
- fConfiguredAnnotationTypes.remove(annotationType);
- if (fConfiguredAnnotationTypes.size() == 0)
- fConfiguredAnnotationTypes= null;
- }
- }
- }
-
- public void updateSummaries(IProgressMonitor monitor) {
- synchronized (fLock) {
- if (fConfiguredAnnotationTypes != null) {
- if (fSummarizer == null)
- fSummarizer= new Summarizer(monitor);
- fSummarizer.reset();
- }
- }
- }
-
- private void internalUpdateSummaries(IProgressMonitor monitor) {
-
- Object previousLockObject= null;
- fAnnotationModel= fProjectionViewer.getVisualAnnotationModel();
- if (fAnnotationModel == null)
- return;
-
- try {
-
-
- IDocument document= fProjectionViewer.getDocument();
- if (document instanceof ISynchronizable && fAnnotationModel instanceof ISynchronizable) {
- ISynchronizable sync= (ISynchronizable) fAnnotationModel;
- previousLockObject= sync.getLockObject();
- sync.setLockObject(((ISynchronizable) document).getLockObject());
- }
-
-
- removeSummaries(monitor);
- createSummaries(monitor);
-
- } finally {
-
- if (fAnnotationModel instanceof ISynchronizable) {
- ISynchronizable sync= (ISynchronizable) fAnnotationModel;
- sync.setLockObject(previousLockObject);
- }
- fAnnotationModel= null;
-
- }
- }
-
- private boolean isCanceled(IProgressMonitor monitor) {
- return monitor != null && monitor.isCanceled();
- }
-
- private void removeSummaries(IProgressMonitor monitor) {
- IAnnotationModelExtension extension= null;
- List bags= null;
-
- if (fAnnotationModel instanceof IAnnotationModelExtension) {
- extension= (IAnnotationModelExtension) fAnnotationModel;
- bags= new ArrayList();
- }
-
- Iterator e= fAnnotationModel.getAnnotationIterator();
- while (e.hasNext()) {
- Annotation annotation= (Annotation) e.next();
- if (annotation instanceof AnnotationBag) {
- if (bags == null)
- fAnnotationModel.removeAnnotation(annotation);
- else
- bags.add(annotation);
- }
-
- if (isCanceled(monitor))
- return;
- }
-
- if (bags != null && bags.size() > 0) {
- Annotation[] deletions= new Annotation[bags.size()];
- bags.toArray(deletions);
- if (!isCanceled(monitor))
- extension.replaceAnnotations(deletions, null);
- }
- }
-
- private void createSummaries(IProgressMonitor monitor) {
- ProjectionAnnotationModel model= fProjectionViewer.getProjectionAnnotationModel();
- if (model == null)
- return;
-
- Map additions= new HashMap();
-
- Iterator e= model.getAnnotationIterator();
- while (e.hasNext()) {
- ProjectionAnnotation projection= (ProjectionAnnotation) e.next();
- if (projection.isCollapsed()) {
- Position position= model.getPosition(projection);
- if (position != null) {
- IRegion summaryRegion= fProjectionViewer.computeCollapsedRegion(position);
- if (summaryRegion != null) {
- Position summaryAnchor= fProjectionViewer.computeCollapsedRegionAnchor(position);
- if (summaryAnchor != null)
- createSummary(additions, summaryRegion, summaryAnchor);
- }
- }
- }
-
- if (isCanceled(monitor))
- return;
- }
-
- if (additions.size() > 0) {
- if (fAnnotationModel instanceof IAnnotationModelExtension) {
- IAnnotationModelExtension extension= (IAnnotationModelExtension) fAnnotationModel;
- if (!isCanceled(monitor))
- extension.replaceAnnotations(null, additions);
- } else {
- Iterator e1= additions.keySet().iterator();
- while (e1.hasNext()) {
- AnnotationBag bag= (AnnotationBag) e1.next();
- Position position= (Position) additions.get(bag);
- if (isCanceled(monitor))
- return;
- fAnnotationModel.addAnnotation(bag, position);
- }
- }
- }
- }
-
- private void createSummary(Map additions, IRegion summaryRange, Position summaryAnchor) {
-
- int size= 0;
- Map map= null;
-
- synchronized (fLock) {
- if (fConfiguredAnnotationTypes != null) {
- size= fConfiguredAnnotationTypes.size();
- map= new HashMap();
- for (int i= 0; i < size; i++) {
- String type= (String) fConfiguredAnnotationTypes.get(i);
- map.put(type, new AnnotationBag(type));
- }
- }
- }
-
- if (map == null)
- return;
-
- IAnnotationModel model= fProjectionViewer.getAnnotationModel();
- Iterator e= model.getAnnotationIterator();
- while (e.hasNext()) {
- Annotation annotation= (Annotation) e.next();
- AnnotationBag bag= findBagForType(map, annotation.getType());
- if (bag != null) {
- Position position= model.getPosition(annotation);
- if (includes(summaryRange, position))
- bag.add(annotation);
- }
- }
-
- for (int i= 0; i < size; i++) {
- AnnotationBag bag= (AnnotationBag) map.get(fConfiguredAnnotationTypes.get(i));
- if (!bag.isEmpty())
- additions.put(bag, new Position(summaryAnchor.getOffset(), summaryAnchor.getLength()));
- }
- }
-
- private AnnotationBag findBagForType(Map bagMap, String annotationType) {
- if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
- IAnnotationAccessExtension extension= (IAnnotationAccessExtension) fAnnotationAccess;
- Object[] superTypes= extension.getSupertypes(annotationType);
- for (int i= 0; i < superTypes.length; i++) {
- AnnotationBag bag= (AnnotationBag) bagMap.get(superTypes[i]);
- if (bag != null)
- return bag;
- }
- }
- return null;
- }
-
- private boolean includes(IRegion range, Position position) {
- if (position != null && !position.isDeleted())
- return range.getOffset() <= position.getOffset() && position.getOffset() + position.getLength() <= range.getOffset() + range.getLength();
- return false;
- }
-}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSupport.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSupport.java
deleted file mode 100644
index 0186418bd..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionSupport.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.text.source.projection;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.custom.StyledTextContent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.AnnotationPainter;
-import org.eclipse.jface.text.source.IAnnotationAccess;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.ISharedTextColors;
-import org.eclipse.jface.text.source.ISourceViewer;
-
-/**
- * Supports the configuration of projection capabilities for projection viewers.
- *
- * @since 3.0
- */
-public class ProjectionSupport {
-
- /**
- * Key of the projection annotation model inside the visual annotation
- * model. Also internally used as key for the projection drawing strategy.
- */
- public final static Object PROJECTION= new Object();
-
- private static class ProjectionAnnotationsPainter extends AnnotationPainter {
- public ProjectionAnnotationsPainter(ISourceViewer sourceViewer, IAnnotationAccess access) {
- super(sourceViewer, access);
- }
-
- /*
- * @see org.eclipse.jface.text.source.AnnotationPainter#findAnnotationModel(org.eclipse.jface.text.source.ISourceViewer)
- */
- protected IAnnotationModel findAnnotationModel(ISourceViewer sourceViewer) {
- if (sourceViewer instanceof ProjectionViewer) {
- ProjectionViewer projectionViewer= (ProjectionViewer) sourceViewer;
- return projectionViewer.getProjectionAnnotationModel();
- }
- return null;
- }
-
- /*
- * @see org.eclipse.jface.text.source.AnnotationPainter#skip(org.eclipse.jface.text.source.Annotation)
- */
- protected boolean skip(Annotation annotation) {
- if (annotation instanceof ProjectionAnnotation)
- return !((ProjectionAnnotation) annotation).isCollapsed();
-
- return super.skip(annotation);
- }
- }
-
- private static class ProjectionDrawingStrategy implements AnnotationPainter.IDrawingStrategy {
- /*
- * @see org.eclipse.jface.text.source.AnnotationPainter.IDrawingStrategy#draw(org.eclipse.swt.graphics.GC, org.eclipse.swt.custom.StyledText, int, int, org.eclipse.swt.graphics.Color)
- */
- public void draw(Annotation annotation, GC gc, StyledText textWidget, int offset, int length, Color color) {
- if (annotation instanceof ProjectionAnnotation) {
- ProjectionAnnotation projectionAnnotation= (ProjectionAnnotation) annotation;
- if (projectionAnnotation.isCollapsed()) {
-
- if (gc != null) {
-
- StyledTextContent content= textWidget.getContent();
- int line= content.getLineAtOffset(offset);
- int lineStart= content.getOffsetAtLine(line);
- String text= content.getLine(line);
- int lineLength= text == null ? 0 : text.length();
- int lineEnd= lineStart + lineLength;
- Point p= textWidget.getLocationAtOffset(lineEnd);
-
- Color c= gc.getForeground();
- gc.setForeground(color);
-
- FontMetrics metrics= gc.getFontMetrics();
-
- // baseline: where the dots are drawn
- int baseline= textWidget.getBaseline();
- // descent: number of pixels that the box extends over baseline
- int descent= Math.min(2, textWidget.getLineHeight() - baseline);
- // ascent: so much does the box stand up from baseline
- int ascent= metrics.getAscent();
- // leading: free space from line top to box upper line
- int leading= baseline - ascent;
- // height: height of the box
- int height= ascent + descent;
-
- int width= metrics.getAverageCharWidth();
- gc.drawRectangle(p.x, p.y + leading, width, height);
- int third= width/3;
- int dotsVertical= p.y + baseline - 1;
- gc.drawPoint(p.x + third, dotsVertical);
- gc.drawPoint(p.x + width - third, dotsVertical);
-
- gc.setForeground(c);
-
- } else {
- textWidget.redrawRange(offset, length, true);
- }
- }
- }
- }
- }
-
- private class ProjectionListener implements IProjectionListener {
-
- /*
- * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionEnabled()
- */
- public void projectionEnabled() {
- doEnableProjection();
- }
-
- /*
- * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionDisabled()
- */
- public void projectionDisabled() {
- doDisableProjection();
- }
- }
-
- private ProjectionViewer fViewer;
- private IAnnotationAccess fAnnotationAccess;
- private ISharedTextColors fSharedTextColors;
- private List fSummarizableTypes;
- private IInformationControlCreator fInformationControlCreator;
- private ProjectionListener fProjectionListener;
- private ProjectionAnnotationsPainter fPainter;
- private ProjectionRulerColumn fColumn;
-
-
- public ProjectionSupport(ProjectionViewer viewer, IAnnotationAccess annotationAccess, ISharedTextColors sharedTextColors) {
- fViewer= viewer;
- fAnnotationAccess= annotationAccess;
- fSharedTextColors= sharedTextColors;
- }
-
- public void addSummarizableAnnotationType(String annotationType) {
- if (fSummarizableTypes == null) {
- fSummarizableTypes= new ArrayList();
- fSummarizableTypes.add(annotationType);
- } else if (!fSummarizableTypes.contains(annotationType))
- fSummarizableTypes.add(annotationType);
- }
-
- public void removeSummarizableAnnotationType(String annotationType) {
- if (fSummarizableTypes != null)
- fSummarizableTypes.remove(annotationType);
- if (fSummarizableTypes.size() == 0)
- fSummarizableTypes= null;
- }
-
- public void setHoverControlCreator(IInformationControlCreator creator) {
- fInformationControlCreator= creator;
- }
-
- public void install() {
- fViewer.setProjectionSummary(createProjectionSummary());
-
- fProjectionListener= new ProjectionListener();
- fViewer.addProjectionListener(fProjectionListener);
- }
-
- public void dispose() {
- if (fProjectionListener != null) {
- fViewer.removeProjectionListener(fProjectionListener);
- fProjectionListener= null;
- }
- }
-
- protected void doEnableProjection() {
-
- if (fPainter == null) {
- fPainter= new ProjectionAnnotationsPainter(fViewer, fAnnotationAccess);
- fPainter.addDrawingStrategy(PROJECTION, new ProjectionDrawingStrategy());
- fPainter.addAnnotationType(ProjectionAnnotation.TYPE, PROJECTION);
- fPainter.setAnnotationTypeColor(ProjectionAnnotation.TYPE, fSharedTextColors.getColor(getColor()));
- fViewer.addPainter(fPainter);
- }
-
- if (fColumn == null) {
- fColumn= new ProjectionRulerColumn(9, fAnnotationAccess);
- fColumn.addAnnotationType(ProjectionAnnotation.TYPE);
- fColumn.setHover(createProjectionAnnotationHover());
- fViewer.addVerticalRulerColumn(fColumn);
- }
-
- fColumn.setModel(fViewer.getVisualAnnotationModel());
- }
-
- protected void doDisableProjection() {
- if (fPainter != null) {
- fViewer.removePainter(fPainter);
- fPainter.dispose();
- fPainter= null;
- }
-
- if (fColumn != null) {
- fViewer.removeVerticalRulerColumn(fColumn);
- fColumn= null;
- }
- }
-
- private ProjectionSummary createProjectionSummary() {
- ProjectionSummary summary= new ProjectionSummary(fViewer, fAnnotationAccess);
- if (fSummarizableTypes != null) {
- int size= fSummarizableTypes.size();
- for (int i= 0; i < size; i++)
- summary.addAnnotationType((String) fSummarizableTypes.get(i));
- }
- return summary;
- }
-
- private IAnnotationHover createProjectionAnnotationHover() {
- ProjectionAnnotationHover hover= new ProjectionAnnotationHover();
- hover.setHoverControlCreator(fInformationControlCreator);
- return hover;
- }
-
- /**
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(ISourceViewer viewer, Class required) {
- if (ProjectionAnnotationModel.class.equals(required)) {
- if (viewer instanceof ProjectionViewer) {
- ProjectionViewer projectionViewer= (ProjectionViewer) viewer;
- return projectionViewer.getProjectionAnnotationModel();
- }
- }
- return null;
- }
-
- private RGB getColor() {
- // TODO read out preference settings
- Color c= Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY);
- return c.getRGB();
- }
-}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java
deleted file mode 100644
index abc767d66..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionViewer.java
+++ /dev/null
@@ -1,1537 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.text.source.projection;
-
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Layout;
-
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentInformationMappingExtension;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ISlaveDocumentManager;
-import org.eclipse.jface.text.ITextViewerExtension5;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.text.projection.ProjectionDocument;
-import org.eclipse.jface.text.projection.ProjectionDocumentEvent;
-import org.eclipse.jface.text.projection.ProjectionDocumentManager;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.AnnotationModelEvent;
-import org.eclipse.jface.text.source.CompositeRuler;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.jface.text.source.IAnnotationModelExtension;
-import org.eclipse.jface.text.source.IAnnotationModelListener;
-import org.eclipse.jface.text.source.IAnnotationModelListenerExtension;
-import org.eclipse.jface.text.source.IOverviewRuler;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.IVerticalRulerColumn;
-import org.eclipse.jface.text.source.SourceViewer;
-
-
-/**
- * A projection source viewer is a source viewer which does not support the
- * concept of a single visible region. Instead it supports multiple visible
- * regions which can dynamically be changed.
- * <p>
- * A projection source viewer uses a <code>ProjectionDocumentManager</code>
- * for the management of the visible document.
- * <p>
- * API in progress. Do not yet use.
- *
- * @since 3.0
- */
-public class ProjectionViewer extends SourceViewer implements ITextViewerExtension5 {
-
- private static final int BASE= INFORMATION; // see ISourceViewer.INFORMATION
-
- /** Operation constant for the expand operation. */
- public static final int EXPAND= BASE + 1;
- /** Operation constant for the collapse operation. */
- public static final int COLLAPSE= BASE + 2;
- /** Operation constant for the toggle projection operation. */
- public static final int TOGGLE= BASE + 3;
- /** Operation constant for the expand all operation. */
- public static final int EXPAND_ALL= BASE + 4;
-
- /**
- * Internal listener to changes of the annotation model.
- */
- private class AnnotationModelListener implements IAnnotationModelListener, IAnnotationModelListenerExtension {
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationModelListener#modelChanged(org.eclipse.jface.text.source.IAnnotationModel)
- */
- public void modelChanged(IAnnotationModel model) {
- processModelChanged(model, null);
- }
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationModelListenerExtension#modelChanged(org.eclipse.jface.text.source.AnnotationModelEvent)
- */
- public void modelChanged(AnnotationModelEvent event) {
- processModelChanged(event.getAnnotationModel(), event);
- }
-
- private void processModelChanged(IAnnotationModel model, AnnotationModelEvent event) {
- if (model == fProjectionAnnotationModel) {
-
- if (fProjectionSummary != null)
- fProjectionSummary.updateSummaries(new NullProgressMonitor());
- processCatchupRequest(event);
-
- } else if (model == getAnnotationModel() && fProjectionSummary != null)
- fProjectionSummary.updateSummaries(new NullProgressMonitor());
- }
- }
-
- /**
- * Executes the 'replaceVisibleDocument' operation when called the first time. Self-destructs afterwards.
- */
- private class ReplaceVisibleDocumentExecutor implements IDocumentListener {
-
- private IDocument fSlaveDocument;
- private IDocument fExecutionTrigger;
-
- public ReplaceVisibleDocumentExecutor(IDocument slaveDocument) {
- fSlaveDocument= slaveDocument;
- }
-
- public void install(IDocument executionTrigger) {
- if (executionTrigger != null && fSlaveDocument != null) {
- fExecutionTrigger= executionTrigger;
- fExecutionTrigger.addDocumentListener(this);
- }
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentAboutToBeChanged(DocumentEvent event) {
- }
-
- /*
- * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- public void documentChanged(DocumentEvent event) {
- fExecutionTrigger.removeDocumentListener(this);
- executeReplaceVisibleDocument(fSlaveDocument);
- }
- }
-
- /**
- * A command reifying a change of the projection document. This can be either
- * adding a master document range, removing a master document change, or invalidating
- * the viewer text presentation.
- */
- private static class ProjectionCommand {
-
- final static int ADD= 0;
- final static int REMOVE= 1;
- final static int INVALIDATE_PRESENTATION= 2;
-
- ProjectionDocument fProjection;
- int fType;
- int fOffset;
- int fLength;
-
- ProjectionCommand(ProjectionDocument projection, int type, int offset, int length) {
- fProjection= projection;
- fType= type;
- fOffset= offset;
- fLength= length;
- }
-
- ProjectionCommand(int offset, int length) {
- fType= INVALIDATE_PRESENTATION;
- fOffset= offset;
- fLength= length;
- }
-
- int computeExpectedCosts() {
-
- switch(fType) {
- case ADD: {
- try {
- IRegion[] gaps= fProjection.computeUnprojectedMasterRegions(fOffset, fLength);
- return gaps == null ? 0 : gaps.length;
- } catch (BadLocationException x) {
- }
- break;
- }
- case REMOVE: {
- try {
- IRegion[] fragments= fProjection.computeProjectedMasterRegions(fOffset, fLength);
- return fragments == null ? 0 : fragments.length;
- } catch (BadLocationException x) {
- }
- break;
- }
- }
- return 0;
- }
- }
-
- /**
- * The queue of projection command objects.
- */
- private static class ProjectionCommandQueue {
-
- final static int REDRAW_COSTS= 15;
- final static int INVALIDATION_COSTS= 10;
-
- List fList= new ArrayList(15);
- int fExpectedExecutionCosts= -1;
-
-
- void add(ProjectionCommand command) {
- fList.add(command);
- }
-
- Iterator iterator() {
- return fList.iterator();
- }
-
- void clear() {
- fList.clear();
- fExpectedExecutionCosts= -1;
- }
-
- boolean passedRedrawCostsThreshold() {
- if (fExpectedExecutionCosts == -1)
- computeExpectedExecutionCosts();
- return fExpectedExecutionCosts > REDRAW_COSTS;
- }
-
- boolean passedInvalidationCostsThreshold() {
- if (fExpectedExecutionCosts == -1)
- computeExpectedExecutionCosts();
- return fExpectedExecutionCosts > INVALIDATION_COSTS;
- }
-
- private void computeExpectedExecutionCosts() {
- int max_costs= Math.max(REDRAW_COSTS, INVALIDATION_COSTS);
- fExpectedExecutionCosts= fList.size();
- if (fExpectedExecutionCosts <= max_costs) {
- ProjectionCommand command;
- Iterator e= fList.iterator();
- while (e.hasNext()) {
- command= (ProjectionCommand) e.next();
- fExpectedExecutionCosts += command.computeExpectedCosts();
- if (fExpectedExecutionCosts > max_costs)
- break;
- }
- }
- }
- }
-
- /** The projection annotation model used by this viewer. */
- private ProjectionAnnotationModel fProjectionAnnotationModel;
- /** The annotation model listener */
- private IAnnotationModelListener fAnnotationModelListener= new AnnotationModelListener();
- /** The projection summary. */
- private ProjectionSummary fProjectionSummary;
- /** Indication that an annotation world change has not yet been processed. */
- private boolean fPendingAnnotationWorldChange= false;
- /** Indication whether projection changes in the visible document should be considered. */
- private boolean fHandleProjectionChanges= true;
- /** The list of projection listeners. */
- private List fProjectionListeners;
- /** Internal lock for protecting the list of pending requests */
- private Object fLock= new Object();
- /** The list of pending requests */
- private List fPendingRequests= new ArrayList();
- /** The replace-visible-document execution trigger */
- private IDocument fReplaceVisibleDocumentExecutionTrigger;
- /** <code>true</code> if projection was on the last time we switched to segmented mode. */
- private boolean fWasProjectionEnabled;
- /** The queue of projection commands used to assess the costs of projection changes. */
- private ProjectionCommandQueue fCommandQueue;
-
-
- /**
- * Creates a new projection source viewer.
- *
- * @param parent the SWT parent control
- * @param ruler the vertical ruler
- * @param overviewRuler the overview ruler
- * @param showsAnnotationOverview <code>true</code> if the overview ruler should be shown
- * @param styles the SWT style bits
- */
- public ProjectionViewer(Composite parent, IVerticalRuler ruler, IOverviewRuler overviewRuler, boolean showsAnnotationOverview, int styles) {
- super(parent, ruler, overviewRuler, showsAnnotationOverview, styles);
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewer#createLayout()
- */
- protected Layout createLayout() {
- return new RulerLayout(1);
- }
-
- /**
- * Sets the projection summary for this viewer.
- *
- * @param projectionSummary the projection summary.
- */
- public void setProjectionSummary(ProjectionSummary projectionSummary) {
- fProjectionSummary= projectionSummary;
- }
-
- /**
- * Adds the projection annotation model to the given annotation model.
- *
- * @param model the model to which the projection annotation model is added
- */
- private void addProjectionAnnotationModel(IAnnotationModel model) {
- if (model instanceof IAnnotationModelExtension) {
- IAnnotationModelExtension extension= (IAnnotationModelExtension) model;
- extension.addAnnotationModel(ProjectionSupport.PROJECTION, fProjectionAnnotationModel);
- model.addAnnotationModelListener(fAnnotationModelListener);
- }
- }
-
- /**
- * Removes the projection annotation model from the given annotation model.
- *
- * @param model the mode from which the projection annotation model is removed
- */
- private IAnnotationModel removeProjectionAnnotationModel(IAnnotationModel model) {
- if (model instanceof IAnnotationModelExtension) {
- model.removeAnnotationModelListener(fAnnotationModelListener);
- IAnnotationModelExtension extension= (IAnnotationModelExtension) model;
- return extension.removeAnnotationModel(ProjectionSupport.PROJECTION);
- }
- return null;
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewer#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) {
- boolean wasProjectionEnabled= false;
-
- synchronized (fLock) {
- fPendingRequests.clear();
- }
-
- if (fProjectionAnnotationModel != null) {
- wasProjectionEnabled= removeProjectionAnnotationModel(getVisualAnnotationModel()) != null;
- fProjectionAnnotationModel= null;
- }
-
- super.setDocument(document, annotationModel, modelRangeOffset, modelRangeLength);
-
- if (wasProjectionEnabled)
- enableProjection();
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewer#createVisualAnnotationModel(org.eclipse.jface.text.source.IAnnotationModel)
- */
- protected IAnnotationModel createVisualAnnotationModel(IAnnotationModel annotationModel) {
- IAnnotationModel model= super.createVisualAnnotationModel(annotationModel);
- fProjectionAnnotationModel= new ProjectionAnnotationModel();
- return model;
- }
-
- /**
- * Returns the projection annotation model.
- *
- * @return the projection annotation model
- */
- public ProjectionAnnotationModel getProjectionAnnotationModel() {
- IAnnotationModel model= getVisualAnnotationModel();
- if (model instanceof IAnnotationModelExtension) {
- IAnnotationModelExtension extension= (IAnnotationModelExtension) model;
- return (ProjectionAnnotationModel) extension.getAnnotationModel(ProjectionSupport.PROJECTION);
- }
- return null;
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#createSlaveDocumentManager()
- */
- protected ISlaveDocumentManager createSlaveDocumentManager() {
- return new ProjectionDocumentManager();
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#updateSlaveDocument(org.eclipse.jface.text.IDocument, int, int)
- */
- protected boolean updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength) throws BadLocationException {
- if (slaveDocument instanceof ProjectionDocument) {
- ProjectionDocument projection= (ProjectionDocument) slaveDocument;
-
- int offset= modelRangeOffset;
- int length= modelRangeLength;
-
- if (!isProjectionMode()) {
- // mimic original TextViewer behavior
- IDocument master= projection.getMasterDocument();
- int line= master.getLineOfOffset(modelRangeOffset);
- offset= master.getLineOffset(line);
- length= (modelRangeOffset - offset) + modelRangeLength;
-
- }
-
- try {
- fHandleProjectionChanges= false;
- projection.replaceMasterDocumentRanges(offset, length);
- } finally {
- fHandleProjectionChanges= true;
- }
- return true;
- }
- return false;
- }
-
- public void addProjectionListener(IProjectionListener listener) {
-
- Assert.isNotNull(listener);
-
- if (fProjectionListeners == null)
- fProjectionListeners= new ArrayList();
-
- if (!fProjectionListeners.contains(listener))
- fProjectionListeners.add(listener);
- }
-
- public void removeProjectionListener(IProjectionListener listener) {
-
- Assert.isNotNull(listener);
-
- if (fProjectionListeners != null) {
- fProjectionListeners.remove(listener);
- if (fProjectionListeners.size() == 0)
- fProjectionListeners= null;
- }
- }
-
- protected void fireProjectionEnabled() {
- if (fProjectionListeners != null) {
- Iterator e= new ArrayList(fProjectionListeners).iterator();
- while (e.hasNext()) {
- IProjectionListener l= (IProjectionListener) e.next();
- l.projectionEnabled();
- }
- }
- }
-
- protected void fireProjectionDisabled() {
- if (fProjectionListeners != null) {
- Iterator e= new ArrayList(fProjectionListeners).iterator();
- while (e.hasNext()) {
- IProjectionListener l= (IProjectionListener) e.next();
- l.projectionDisabled();
- }
- }
- }
-
- /**
- * Returns whether this viewer is in projection mode.
- *
- * @return <code>true</code> if this viewer is in projection mode,
- * <code>false</code> otherwise
- */
- public final boolean isProjectionMode() {
- return getProjectionAnnotationModel() != null;
- }
-
- /**
- * Disables the projection mode.
- */
- public final void disableProjection() {
- if (isProjectionMode()) {
- removeProjectionAnnotationModel(getVisualAnnotationModel());
- fProjectionAnnotationModel.removeAllAnnotations();
- fFindReplaceDocumentAdapter= null;
- fireProjectionDisabled();
- }
- }
-
- /**
- * Enables the projection mode.
- */
- public final void enableProjection() {
- if (!isProjectionMode()) {
- addProjectionAnnotationModel(getVisualAnnotationModel());
- fFindReplaceDocumentAdapter= null;
- fireProjectionEnabled();
- }
- }
-
- private void expandAll() {
- int offset= 0;
- IDocument doc= getDocument();
- int length= doc == null ? 0 : doc.getLength();
- if (isProjectionMode()) {
- fProjectionAnnotationModel.expandAll(offset, length);
- }
- }
-
- private void expand() {
- if (isProjectionMode()) {
- Position found= null;
- Annotation bestMatch= null;
- Point selection= getSelectedRange();
- for (Iterator e= fProjectionAnnotationModel.getAnnotationIterator(); e.hasNext();) {
- ProjectionAnnotation annotation= (ProjectionAnnotation) e.next();
- if (annotation.isCollapsed()) {
- Position position= fProjectionAnnotationModel.getPosition(annotation);
- // take the first most fine grained match
- if (position != null && touches(selection, position))
- if (found == null || position.includes(found.offset) && position.includes(found.offset + found.length)) {
- found= position;
- bestMatch= annotation;
- }
- }
- }
-
- if (bestMatch != null)
- fProjectionAnnotationModel.expand(bestMatch);
- }
- }
-
- private boolean touches(Point selection, Position position) {
- return position.overlapsWith(selection.x, selection.y) || selection.y == 0 && position.offset + position.length == selection.x + selection.y;
- }
-
- private void collapse() {
- if (isProjectionMode()) {
- Position found= null;
- Annotation bestMatch= null;
- Point selection= getSelectedRange();
- for (Iterator e= fProjectionAnnotationModel.getAnnotationIterator(); e.hasNext();) {
- ProjectionAnnotation annotation= (ProjectionAnnotation) e.next();
- if (!annotation.isCollapsed()) {
- Position position= fProjectionAnnotationModel.getPosition(annotation);
- // take the first most fine grained match
- if (position != null && touches(selection, position))
- if (found == null || found.includes(position.offset) && found.includes(position.offset + position.length)) {
- found= position;
- bestMatch= annotation;
- }
- }
- }
-
- if (bestMatch != null)
- fProjectionAnnotationModel.collapse(bestMatch);
- }
- }
-
- /**
- * Remembers whether to listen to projection changes of the visible
- * document.
- *
- * @see ProjectionDocument#addMasterDocumentRange(int, int)
- */
- private void addMasterDocumentRange(ProjectionDocument projection, int offset, int length) throws BadLocationException {
-
- if (fCommandQueue != null) {
- fCommandQueue.add(new ProjectionCommand(projection, ProjectionCommand.ADD, offset, length));
- } else {
- try {
- fHandleProjectionChanges= false;
- projection.addMasterDocumentRange(offset, length);
- } finally {
- fHandleProjectionChanges= true;
- }
- }
- }
-
- /**
- * Remembers whether to listen to projection changes of the visible
- * document.
- *
- * @see ProjectionDocument#removeMasterDocumentRange(int, int)
- */
- private void removeMasterDocumentRange(ProjectionDocument projection, int offset, int length) throws BadLocationException {
- if (fCommandQueue != null) {
- fCommandQueue.add(new ProjectionCommand(projection, ProjectionCommand.REMOVE, offset, length));
- } else {
- try {
- fHandleProjectionChanges= false;
- projection.removeMasterDocumentRange(offset, length);
- } finally {
- fHandleProjectionChanges= true;
- }
- }
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#setVisibleRegion(int, int)
- */
- public void setVisibleRegion(int start, int length) {
- if (!isSegmented())
- fWasProjectionEnabled= isProjectionMode();
- disableProjection();
- super.setVisibleRegion(start, length);
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#setVisibleDocument(org.eclipse.jface.text.IDocument)
- */
- protected void setVisibleDocument(IDocument document) {
- if (!isProjectionMode()) {
- super.setVisibleDocument(document);
- return;
- }
-
- // In projection mode we don't want to throw away the find/replace document adapter
- FindReplaceDocumentAdapter adapter= fFindReplaceDocumentAdapter;
- super.setVisibleDocument(document);
- fFindReplaceDocumentAdapter= adapter;
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#resetVisibleRegion()
- */
- public void resetVisibleRegion() {
- super.resetVisibleRegion();
- if (fWasProjectionEnabled)
- enableProjection();
- }
-
- /*
- * @see org.eclipse.jface.text.ITextViewer#getVisibleRegion()
- */
- public IRegion getVisibleRegion() {
- disableProjection();
- IRegion visibleRegion= getModelCoverage();
- if (visibleRegion == null)
- visibleRegion= new Region(0, 0);
-
- return visibleRegion;
- }
-
- /*
- * @see org.eclipse.jface.text.ITextViewer#overlapsWithVisibleRegion(int,int)
- */
- public boolean overlapsWithVisibleRegion(int offset, int length) {
- disableProjection();
- IRegion coverage= getModelCoverage();
- if (coverage == null)
- return false;
-
- boolean appending= (offset == coverage.getOffset() + coverage.getLength()) && length == 0;
- return appending || TextUtilities.overlaps(coverage, new Region(offset, length));
- }
-
- /**
- * Replace the visible document with the given document. Maintains the
- * scroll offset and the selection.
- *
- * @param visibleDocument the visible document
- */
- private void replaceVisibleDocument(IDocument slave) {
- if (fReplaceVisibleDocumentExecutionTrigger != null) {
- ReplaceVisibleDocumentExecutor executor= new ReplaceVisibleDocumentExecutor(slave);
- executor.install(fReplaceVisibleDocumentExecutionTrigger);
- } else
- executeReplaceVisibleDocument(slave);
- }
-
-
- private void executeReplaceVisibleDocument(IDocument visibleDocument) {
- StyledText textWidget= getTextWidget();
- try {
- if (textWidget != null && !textWidget.isDisposed())
- textWidget.setRedraw(false);
-
- int topIndex= getTopIndex();
- Point selection= getSelectedRange();
- setVisibleDocument(visibleDocument);
- setSelectedRange(selection.x, selection.y);
- setTopIndex(topIndex);
-
- } finally {
- if (textWidget != null && !textWidget.isDisposed())
- textWidget.setRedraw(true);
- }
- }
-
- /**
- * Hides the given range by collapsing it. If requested, a redraw request is issued.
- *
- * @param offset the offset of the range to hide
- * @param length the length of the range to hide
- * @param fireRedraw <code>true</code> if a redraw request should be issued, <code>false</code> otherwise
- * @throws BadLocationException in case the range is invalid
- */
- private void collapse(int offset, int length, boolean fireRedraw) throws BadLocationException {
- ProjectionDocument projection= null;
-
- IDocument visibleDocument= getVisibleDocument();
- if (visibleDocument instanceof ProjectionDocument)
- projection= (ProjectionDocument) visibleDocument;
- else {
- IDocument master= getDocument();
- IDocument slave= createSlaveDocument(getDocument());
- if (slave instanceof ProjectionDocument) {
- projection= (ProjectionDocument) slave;
- addMasterDocumentRange(projection, 0, master.getLength());
- replaceVisibleDocument(projection);
- }
- }
-
- if (projection != null)
- removeMasterDocumentRange(projection, offset, length);
-
- if (projection != null && fireRedraw) {
- // repaint line above
- IDocument document= getDocument();
- int line= document.getLineOfOffset(offset);
- if (line > 0) {
- IRegion info= document.getLineInformation(line - 1);
- internalInvalidateTextPresentation(info.getOffset(), info.getLength());
- }
- }
- }
-
- /**
- * Makes the given range visible again while keeping the given collapsed
- * ranges. If requested, a redraw request is issued.
- *
- * @param expanded the range to be expanded
- * @param collapsed a sequence of collapsed ranges completely contained by
- * the expanded range
- * @param fireRedraw <code>true</code> if a redraw request should be
- * issued, <code>false</code> otherwise
- * @throws BadLocationException in case the range is invalid
- */
- private void expand(Position expanded, Position[] collapsed, boolean fireRedraw) throws BadLocationException {
- IDocument slave= getVisibleDocument();
- if (slave instanceof ProjectionDocument) {
- ProjectionDocument projection= (ProjectionDocument) slave;
-
- // expand
- addMasterDocumentRange(projection, expanded.getOffset(), expanded.getLength());
-
- // collapse contained regions
- if (collapsed != null) {
- for (int i= 0; i < collapsed.length; i++) {
- IRegion p= computeCollapsedRegion(collapsed[i]);
- removeMasterDocumentRange(projection, p.getOffset(), p.getLength());
- }
- }
- }
- }
-
- /**
- * Processes the request for catch up with the annotation model in the UI thread. If the current
- * thread is not the UI thread or there are pending catch up requests, a new request is posted.
- *
- * @param event the annotation model event
- */
- protected final void processCatchupRequest(AnnotationModelEvent event) {
- if (Display.getCurrent() != null) {
- boolean run= false;
- synchronized (fLock) {
- run= fPendingRequests.isEmpty();
- }
- if (run) {
-
- try {
- catchupWithProjectionAnnotationModel(event);
- } catch (BadLocationException x) {
- throw new IllegalArgumentException();
- }
-
- } else
- postCatchupRequest(event);
- } else {
- postCatchupRequest(event);
- }
- }
-
- /**
- * Posts the request for catch up with the annotation model into the UI thread.
- *
- * @param event the annotation model event
- */
- protected final void postCatchupRequest(final AnnotationModelEvent event) {
- synchronized (fLock) {
- fPendingRequests.add(event);
- if (fPendingRequests.size() == 1) {
- StyledText widget= getTextWidget();
- if (widget != null) {
- Display display= widget.getDisplay();
- if (display != null) {
- display.asyncExec(new Runnable() {
- public void run() {
- try {
- while (true) {
- AnnotationModelEvent ame= null;
- synchronized (fLock) {
- if (fPendingRequests.size() == 0)
- return;
- ame= (AnnotationModelEvent) fPendingRequests.remove(0);
- }
- catchupWithProjectionAnnotationModel(ame);
- }
- } catch (BadLocationException x) {
- try {
- catchupWithProjectionAnnotationModel(null);
- } catch (BadLocationException x1) {
- throw new IllegalArgumentException();
- } finally {
- synchronized (fLock) {
- fPendingRequests.clear();
- }
- }
- }
- }
- });
- }
- }
- }
- }
- }
-
- /**
- * Adapts the slave visual document of this viewer to the changes described
- * in the annotation model event. When the event is <code>null</code>,
- * this is identical to a world change event.
- *
- * @param event the annotation model event or <code>null</code>
- * @exception BadLocationException in case the annotation model event is no longer in sync with the document
- */
- private void catchupWithProjectionAnnotationModel(AnnotationModelEvent event) throws BadLocationException {
- if (event == null) {
-
- fPendingAnnotationWorldChange= false;
- reinitializeProjection();
-
- } else if (event.isWorldChange()) {
-
- if (event.isValid()) {
- fPendingAnnotationWorldChange= false;
- reinitializeProjection();
- } else
- fPendingAnnotationWorldChange= true;
-
- } else {
-
- if (fPendingAnnotationWorldChange) {
- if (event.isValid()) {
- fPendingAnnotationWorldChange= false;
- reinitializeProjection();
- }
- } else {
-
- Annotation[] addedAnnotations= event.getAddedAnnotations();
- Annotation[] changedAnnotation= event.getChangedAnnotations();
- Annotation[] removedAnnotations= event.getRemovedAnnotations();
-
- fCommandQueue= new ProjectionCommandQueue();
-
- int topIndex= getTopIndex();
-
- processDeletions(event, removedAnnotations, true);
- List coverage= new ArrayList();
- processChanges(addedAnnotations, true, coverage);
- processChanges(changedAnnotation, true, coverage);
-
- ProjectionCommandQueue commandQueue= fCommandQueue;
- fCommandQueue= null;
-
- if (commandQueue.passedRedrawCostsThreshold()) {
-
- setRedraw(false);
- try {
-
- try {
- executeProjectionCommands(commandQueue, false);
- } catch (IllegalArgumentException x) {
- reinitializeProjection();
- }
-
- } finally {
- setRedraw(true, topIndex);
- }
-
- } else {
-
- Point selection= getSelectedRange();
- StyledText textWidget= getTextWidget();
-
- try {
- if (textWidget != null && !textWidget.isDisposed())
- textWidget.setRedraw(false);
-
- boolean fireRedraw= !commandQueue.passedInvalidationCostsThreshold();
- try {
- boolean visibleDocumentReplaced= executeProjectionCommands(commandQueue, fireRedraw);
- if (!visibleDocumentReplaced && !fireRedraw)
- invalidateTextPresentation();
- } catch (IllegalArgumentException x) {
- reinitializeProjection();
- }
-
- } finally {
-
- if (selection.x != -1 && selection.y != -1)
- setSelectedRange(selection.x, selection.y);
-
- if (textWidget != null && !textWidget.isDisposed()) {
- if (topIndex != -1)
- setTopIndex(topIndex);
- textWidget.setRedraw(true);
- }
- }
- }
-
- }
-
- }
- }
-
- private boolean executeProjectionCommands(ProjectionCommandQueue commandQueue, boolean fireRedraw) throws BadLocationException {
-
- ProjectionCommand command;
- Iterator e= commandQueue.iterator();
- while (e.hasNext()) {
- command= (ProjectionCommand) e.next();
- switch (command.fType) {
- case ProjectionCommand.ADD:
- addMasterDocumentRange(command.fProjection, command.fOffset, command.fLength);
- break;
- case ProjectionCommand.REMOVE:
- removeMasterDocumentRange(command.fProjection, command.fOffset, command.fLength);
- break;
- case ProjectionCommand.INVALIDATE_PRESENTATION:
- if (fireRedraw)
- invalidateTextPresentation(command.fOffset, command.fLength);
- break;
- }
- }
-
- commandQueue.clear();
-
- IDocument master= getDocument();
- IDocument slave= getVisibleDocument();
- if (slave instanceof ProjectionDocument && slave.getLength() == master.getLength()) {
- replaceVisibleDocument(master);
- return true;
- }
- return false;
- }
-
- private boolean covers(Position expanded, Position position) {
- if (!expanded.equals(position) && !position.isDeleted())
- return expanded.getOffset() <= position.getOffset() && position.getOffset() + position.getLength() <= expanded.getOffset() + expanded.getLength();
- return false;
- }
-
- private Position[] computeCollapsedRanges(Position expanded) {
- List positions= new ArrayList(5);
- Iterator e= fProjectionAnnotationModel.getAnnotationIterator();
- while (e.hasNext()) {
- ProjectionAnnotation annotation= (ProjectionAnnotation) e.next();
- if (annotation.isCollapsed()) {
- Position position= fProjectionAnnotationModel.getPosition(annotation);
- if (position == null) {
- // annotation might already be deleted, we will be informed later on about this deletion
- continue;
- }
- if (covers(expanded, position))
- positions.add(position);
- }
- }
-
- if (positions.size() > 0) {
- Position[] result= new Position[positions.size()];
- positions.toArray(result);
- return result;
- }
-
- return null;
- }
-
- private void internalInvalidateTextPresentation(int offset, int length) {
- if (fCommandQueue != null) {
- fCommandQueue.add(new ProjectionCommand(offset, length));
- } else {
- invalidateTextPresentation(offset, length);
- }
- }
-
- /*
- * We pass the removed annotation into this method for performance reasons only. Otherwise, they could be fetch from the event.
- */
- private void processDeletions(AnnotationModelEvent event, Annotation[] removedAnnotations, boolean fireRedraw) throws BadLocationException {
- for (int i= 0; i < removedAnnotations.length; i++) {
- ProjectionAnnotation annotation= (ProjectionAnnotation) removedAnnotations[i];
- if (annotation.isCollapsed()) {
- Position expanded= event.getPositionOfRemovedAnnotation(annotation);
- Position[] collapsed= computeCollapsedRanges(expanded);
- expand(expanded, collapsed, false);
- if (fireRedraw)
- internalInvalidateTextPresentation(expanded.getOffset(), expanded.getLength());
- }
- }
- }
-
- public IRegion computeCollapsedRegion(Position position) {
- try {
- IDocument document= getDocument();
- int line= document.getLineOfOffset(position.getOffset());
- int offset= document.getLineOffset(line + 1);
-
- int length= position.getLength() - (offset - position.getOffset());
- if (length > 0)
- return new Region(offset, length);
- } catch (BadLocationException x) {
- }
-
- return null;
- }
-
- public Position computeCollapsedRegionAnchor(Position position) {
- try {
- IDocument document= getDocument();
- IRegion lineInfo= document.getLineInformationOfOffset(position.getOffset());
- return new Position(lineInfo.getOffset() + lineInfo.getLength(), 0);
- } catch (BadLocationException x) {
- }
- return null;
- }
-
- private void processChanges(Annotation[] annotations, boolean fireRedraw, List coverage) throws BadLocationException {
- for (int i= 0; i < annotations.length; i++) {
- ProjectionAnnotation annotation= (ProjectionAnnotation) annotations[i];
- Position position= fProjectionAnnotationModel.getPosition(annotation);
-
- if (position == null)
- continue;
-
- if (annotation.isCollapsed()) {
- if (!covers(coverage, position)) {
- coverage.add(position);
- IRegion region= computeCollapsedRegion(position);
- if (region != null)
- collapse(region.getOffset(), region.getLength(), fireRedraw);
- }
- } else {
- if (!covers(coverage, position)) {
- Position[] collapsed= computeCollapsedRanges(position);
- expand(position, collapsed, false);
- if (fireRedraw)
- internalInvalidateTextPresentation(position.getOffset(), position.getLength());
- }
- }
- }
- }
-
- private boolean covers(List coverage, Position position) {
- Iterator e= coverage.iterator();
- while (e.hasNext()) {
- Position p= (Position) e.next();
- if (p.getOffset() <= position.getOffset() && position.getOffset() + position.getLength() <= p.getOffset() + p.getLength())
- return true;
- }
- return false;
- }
-
- public final void reinitializeProjection() throws BadLocationException {
-
- ProjectionDocument projection= null;
-
- ISlaveDocumentManager manager= getSlaveDocumentManager();
- if (manager != null) {
- IDocument master= getDocument();
- if (master != null) {
- IDocument slave= manager.createSlaveDocument(master);
- if (slave instanceof ProjectionDocument) {
- projection= (ProjectionDocument) slave;
- addMasterDocumentRange(projection, 0, master.getLength());
- }
- }
- }
-
- if (projection != null) {
- Iterator e= fProjectionAnnotationModel.getAnnotationIterator();
- while (e.hasNext()) {
- ProjectionAnnotation annotation= (ProjectionAnnotation) e.next();
- if (annotation.isCollapsed()) {
- Position position= fProjectionAnnotationModel.getPosition(annotation);
- if (position != null) {
- IRegion region= computeCollapsedRegion(position);
- if (region != null)
- removeMasterDocumentRange(projection, region.getOffset(), region.getLength());
- }
- }
- }
-
- }
-
- replaceVisibleDocument(projection);
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#handleVerifyEvent(org.eclipse.swt.events.VerifyEvent)
- */
- protected void handleVerifyEvent(VerifyEvent e) {
- IRegion modelRange= event2ModelRange(e);
- if (exposeModelRange(modelRange))
- e.doit= false;
- else
- super.handleVerifyEvent(e);
- }
-
- /**
- * Adds the give column as last column to this viewer's vertical ruler.
- *
- * @param column the column to be added
- */
- public void addVerticalRulerColumn(IVerticalRulerColumn column) {
- IVerticalRuler ruler= getVerticalRuler();
- if (ruler instanceof CompositeRuler) {
- CompositeRuler compositeRuler= (CompositeRuler) ruler;
- compositeRuler.addDecorator(99, column);
- }
- }
-
- /**
- * Removes the give column from this viewer's vertical ruler.
- *
- * @param column the column to be removed
- */
- public void removeVerticalRulerColumn(IVerticalRulerColumn column) {
- IVerticalRuler ruler= getVerticalRuler();
- if (ruler instanceof CompositeRuler) {
- CompositeRuler compositeRuler= (CompositeRuler) ruler;
- compositeRuler.removeDecorator(column);
- }
- }
-
- /*
- * @see org.eclipse.jface.text.ITextViewerExtension5#exposeModelRange(org.eclipse.jface.text.IRegion)
- */
- public boolean exposeModelRange(IRegion modelRange) {
- if (isProjectionMode())
- return fProjectionAnnotationModel.expandAll(modelRange.getOffset(), modelRange.getLength());
-
- if (!overlapsWithVisibleRegion(modelRange.getOffset(), modelRange.getLength())) {
- resetVisibleRegion();
- return true;
- }
-
- return false;
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewer#setRangeIndication(int, int, boolean)
- */
- public void setRangeIndication(int offset, int length, boolean moveCursor) {
-
- List expand= new ArrayList(2);
- if (moveCursor) {
-
- // expand the immediate effected collapsed regions
- Iterator iterator= fProjectionAnnotationModel.getAnnotationIterator();
- while (iterator.hasNext()) {
- ProjectionAnnotation annotation= (ProjectionAnnotation) iterator.next();
- if (annotation.isCollapsed() && willAutoExpand(fProjectionAnnotationModel.getPosition(annotation), offset, length))
- expand.add(annotation);
- }
-
- if (!expand.isEmpty()) {
- Iterator e= expand.iterator();
- while (e.hasNext())
- fProjectionAnnotationModel.expand((Annotation) e.next());
- }
- }
-
- super.setRangeIndication(offset, length, moveCursor);
- }
-
- private boolean willAutoExpand(Position position, int offset, int length) {
- if (position == null || position.isDeleted())
- return false;
- // right or left boundary
- if (position.getOffset() == offset || position.getOffset() + position.getLength() == offset + length)
- return true;
- // completely embedded in given position
- if (position.getOffset() < offset && offset + length < position.getOffset() + position.getLength())
- return true;
- return false;
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewer#handleDispose()
- * @since 3.0
- */
- protected void handleDispose() {
- fWasProjectionEnabled= false;
- super.handleDispose();
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#handleVisibleDocumentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- protected void handleVisibleDocumentChanged(DocumentEvent event) {
- if (fHandleProjectionChanges && event instanceof ProjectionDocumentEvent && isProjectionMode()) {
- ProjectionDocumentEvent e= (ProjectionDocumentEvent) event;
-
- DocumentEvent master= e.getMasterEvent();
- if (master != null)
- fReplaceVisibleDocumentExecutionTrigger= master.getDocument();
-
- try {
-
- int replaceLength= e.getText() == null ? 0 : e.getText().length();
- if (ProjectionDocumentEvent.PROJECTION_CHANGE == e.getChangeType()) {
- if (e.getLength() == 0 && replaceLength != 0)
- fProjectionAnnotationModel.expandAll(e.getMasterOffset(), e.getMasterLength());
- } else if (master != null && replaceLength > 0 ) {
- try {
- int numberOfLines= e.getDocument().getNumberOfLines(e.getOffset(), replaceLength);
- if (numberOfLines > 1)
- fProjectionAnnotationModel.expandAll(master.getOffset(), master.getLength());
- } catch (BadLocationException x) {
- }
- }
-
- } finally {
- fReplaceVisibleDocumentExecutionTrigger= null;
- }
-
- }
- }
-
- /*
- * @see org.eclipse.jface.text.ITextViewerExtension5#getCoveredModelRanges(org.eclipse.jface.text.IRegion)
- */
- public IRegion[] getCoveredModelRanges(IRegion modelRange) {
- if (fInformationMapping == null)
- return new IRegion[] { new Region(modelRange.getOffset(), modelRange.getLength()) };
-
- if (fInformationMapping instanceof IDocumentInformationMappingExtension) {
- IDocumentInformationMappingExtension extension= (IDocumentInformationMappingExtension) fInformationMapping;
- try {
- return extension.getExactCoverage(modelRange);
- } catch (BadLocationException x) {
- }
- }
-
- return null;
- }
-
- /*
- * @see org.eclipse.jface.text.ITextOperationTarget#doOperation(int)
- */
- public void doOperation(int operation) {
- switch (operation) {
- case TOGGLE:
- if (canDoOperation(TOGGLE)) {
- if (!isProjectionMode()) {
- enableProjection();
- } else {
- expandAll();
- disableProjection();
- }
- return;
- }
- }
-
- if (!isProjectionMode()) {
- super.doOperation(operation);
- return;
- }
-
- StyledText textWidget= getTextWidget();
- if (textWidget == null)
- return;
-
- Point selection= null;
- switch (operation) {
-
- case CUT:
-
- if (redraws()) {
- selection= getSelectedRange();
- if (selection.y == 0)
- copyMarkedRegion(true);
- else
- copyToClipboard(selection.x, selection.y, true, textWidget);
-
- selection= textWidget.getSelectionRange();
- fireSelectionChanged(selection.x, selection.y);
- }
- break;
-
- case COPY:
-
- if (redraws()) {
- selection= getSelectedRange();
- if (selection.y == 0)
- copyMarkedRegion(false);
- else
- copyToClipboard(selection.x, selection.y, false, textWidget);
- }
- break;
-
- case DELETE:
-
- if (redraws()) {
- try {
- selection= getSelectedRange();
- Point widgetSelection= textWidget.getSelectionRange();
- if (selection.y == 0 || selection.y == widgetSelection.y)
- deleteText();
- else
- deleteTextRange(selection.x, selection.y, textWidget);
-
- selection= textWidget.getSelectionRange();
- fireSelectionChanged(selection.x, selection.y);
-
- } catch (BadLocationException x) {
- // ignore
- }
- }
- break;
-
-
- case EXPAND_ALL:
- if (redraws())
- expandAll();
- break;
-
- case EXPAND:
- if (redraws()) {
- expand();
- }
- break;
-
- case COLLAPSE:
- if (redraws()) {
- collapse();
- }
- break;
-
- default:
- super.doOperation(operation);
- }
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewer#canDoOperation(int)
- */
- public boolean canDoOperation(int operation) {
-
- switch (operation) {
- case COLLAPSE:
- case EXPAND:
- case EXPAND_ALL:
- return isProjectionMode();
- case TOGGLE:
- return !isSegmented();
- }
-
- return super.canDoOperation(operation);
- }
-
- private boolean isSegmented() {
- IDocument document= getDocument();
- int length= document == null ? 0 : document.getLength();
- IRegion visible= getModelCoverage();
- boolean isSegmented= visible != null && !visible.equals(new Region(0, length));
- return isSegmented;
- }
-
- private IRegion getMarkedRegion() {
- if (getTextWidget() == null)
- return null;
-
- if (fMarkPosition == null || fMarkPosition.isDeleted())
- return null;
-
- int start= fMarkPosition.getOffset();
- int end= getSelectedRange().x;
-
- return start > end ? new Region (end, start - end) : new Region(start, end - start);
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#copyMarkedRegion(boolean)
- */
- protected void copyMarkedRegion(boolean delete) {
- IRegion markedRegion= getMarkedRegion();
- if (markedRegion != null)
- copyToClipboard(markedRegion.getOffset(), markedRegion.getLength(), delete, getTextWidget());
- }
-
- private void copyToClipboard(int offset, int length, boolean delete, StyledText textWidget) {
-
- IDocument document= getDocument();
- Clipboard clipboard= new Clipboard(textWidget.getDisplay());
-
- try {
-
- Transfer[] dataTypes= new Transfer[] { TextTransfer.getInstance() };
- Object[] data= new Object[] { document.get(offset, length) };
- try {
- clipboard.setContents(data, dataTypes);
- } catch (SWTError e) {
- if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD)
- throw e;
- // TODO see https://bugs.eclipse.org/bugs/show_bug.cgi?id=59459
- // we should either log and/or inform the user
- // silently fail for now.
- return;
- }
-
- if (delete)
- deleteTextRange(offset, length, textWidget);
-
- } catch (BadLocationException x) {
- } finally {
- clipboard.dispose();
- }
- }
-
- private void deleteTextRange(int offset, int length, StyledText textWidget) throws BadLocationException {
- getDocument().replace(offset, length, null);
- int widgetCaret= modelOffset2WidgetOffset(offset);
- if (widgetCaret > -1)
- textWidget.setSelection(widgetCaret);
- }
-
- /**
- * Adapts the behavior to line based folding.
- */
- protected Point widgetSelection2ModelSelection(Point widgetSelection) {
-
- if (!isProjectionMode())
- return super.widgetSelection2ModelSelection(widgetSelection);
-
- IRegion modelSelection= widgetRange2ModelRange(new Region(widgetSelection.x, widgetSelection.y));
- if (modelSelection == null)
- return null;
-
- int modelOffset= modelSelection.getOffset();
- int modelLength= modelSelection.getLength();
- if (getVisibleDocument().getLength() == 0)
- modelLength= 0;
-
- int widgetSelectionExclusiveEnd= widgetSelection.x + widgetSelection.y;
- int modelExclusiveEnd= widgetOffset2ModelOffset(widgetSelectionExclusiveEnd);
-
- if (modelOffset + modelLength < modelExclusiveEnd)
- return new Point(modelOffset, modelExclusiveEnd - modelOffset);
-
- if (widgetSelectionExclusiveEnd == getVisibleDocument().getLength() && widgetSelectionExclusiveEnd > 0)
- return new Point(modelOffset, getDocument().getLength() - modelOffset);
-
- return new Point(modelOffset, modelLength);
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#getFindReplaceDocumentAdapter()
- */
- protected FindReplaceDocumentAdapter getFindReplaceDocumentAdapter() {
- if (fFindReplaceDocumentAdapter == null) {
- IDocument document= isProjectionMode() ? getDocument() : getVisibleDocument();
- fFindReplaceDocumentAdapter= new FindReplaceDocumentAdapter(document);
- }
- return fFindReplaceDocumentAdapter;
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#findAndSelect(int, java.lang.String, boolean, boolean, boolean, boolean)
- */
- protected int findAndSelect(int startPosition, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord, boolean regExSearch) {
-
- if (!isProjectionMode())
- return super.findAndSelect(startPosition, findString, forwardSearch, caseSensitive, wholeWord, regExSearch);
-
- StyledText textWidget= getTextWidget();
- if (textWidget == null)
- return -1;
-
- try {
-
- IRegion matchRegion= getFindReplaceDocumentAdapter().find(startPosition, findString, forwardSearch, caseSensitive, wholeWord, regExSearch);
- if (matchRegion != null) {
- exposeModelRange(matchRegion);
- setSelectedRange(matchRegion.getOffset(), matchRegion.getLength());
- textWidget.showSelection();
- return matchRegion.getOffset();
- }
-
- } catch (BadLocationException x) {
- }
-
- return -1;
- }
-
- /*
- * @see org.eclipse.jface.text.TextViewer#findAndSelectInRange(int, java.lang.String, boolean, boolean, boolean, int, int, boolean)
- */
- protected int findAndSelectInRange(int startPosition, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord, int rangeOffset, int rangeLength, boolean regExSearch) {
-
- if (!isProjectionMode())
- return super.findAndSelect(startPosition, findString, forwardSearch, caseSensitive, wholeWord, regExSearch);
-
- StyledText textWidget= getTextWidget();
- if (textWidget == null)
- return -1;
-
- try {
-
- int modelOffset= startPosition;
- if (forwardSearch && (startPosition == -1 || startPosition < rangeOffset)) {
- modelOffset= rangeOffset;
- } else if (!forwardSearch && (startPosition == -1 || startPosition > rangeOffset + rangeLength)) {
- modelOffset= rangeOffset + rangeLength;
- }
-
- IRegion matchRegion= getFindReplaceDocumentAdapter().find(modelOffset, findString, forwardSearch, caseSensitive, wholeWord, regExSearch);
- if (matchRegion != null) {
- int offset= matchRegion.getOffset();
- int length= matchRegion.getLength();
- if (rangeOffset <= offset && offset + length <= rangeOffset + rangeLength) {
- exposeModelRange(matchRegion);
- setSelectedRange(offset, length);
- textWidget.showSelection();
- return offset;
- }
- }
-
- } catch (BadLocationException x) {
- }
-
- return -1;
- }
-}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
deleted file mode 100644
index 37274bafe..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jface.text.source.projection;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-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.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-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.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.resource.JFaceResources;
-
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlExtension;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-
-/**
- * Source viewer based implementation of <code>IInformationControl</code>.
- * Displays information in a source viewer.
- * <p>
- * Internal class. Do not use. Public only for testing purposes.
- *
- * @since 3.0
- */
-class SourceViewerInformationControl implements IInformationControl, IInformationControlExtension, DisposeListener {
-
- /** Border thickness in pixels. */
- private static final int BORDER= 1;
-
-
- /** The control's shell */
- private Shell fShell;
- /** The control's text widget */
- private StyledText fText;
- /** The control's source viewer */
- private SourceViewer fViewer;
- /** The optional status field. */
- private Label fStatusField;
- /** The separator for the optional status field. */
- private Label fSeparator;
- /** The font of the optional status text label.*/
- private Font fStatusTextFont;
- /** The maximal widget width. */
- private int fMaxWidth;
- /** The maximal widget height. */
- private int fMaxHeight;
-
-
- /**
- * Creates a source viewer information control with the given shell as
- * parent and the given font.
- *
- * @param parent the parent shell
- * @param symbolicFontName the symbolic font name
- */
- public SourceViewerInformationControl(Shell parent, String symbolicFontName) {
- this(parent, SWT.NO_TRIM, SWT.NONE, symbolicFontName, null);
- }
-
- /**
- * Creates a source viewer information control with the given shell as
- * parent. The given shell styles are applied to the created shell. The
- * given styles are applied to the created styled text widget. The text
- * widget will be initialized with the given font. The status field will
- * contain the given text or be hidden.
- *
- * @param parent the parent shell
- * @param shellStyle the additional styles for the shell
- * @param style the additional styles for the styled text widget
- * @param symbolicFontName the symbolic font name
- * @param statusFieldText the text to be used in the optional status field
- * or <code>null</code> if the status field should be hidden
- */
- public SourceViewerInformationControl(Shell parent, int shellStyle, int style, String symbolicFontName, String statusFieldText) {
- GridLayout layout;
- GridData gd;
-
- fShell= new Shell(parent, SWT.NO_FOCUS | SWT.ON_TOP | shellStyle);
- Display display= fShell.getDisplay();
- fShell.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
-
- Composite composite= fShell;
- layout= new GridLayout(1, false);
- int border= ((shellStyle & SWT.NO_TRIM) == 0) ? 0 : BORDER;
- layout.marginHeight= border;
- layout.marginWidth= border;
- composite.setLayout(layout);
- gd= new GridData(GridData.FILL_HORIZONTAL);
- composite.setLayoutData(gd);
-
- if (statusFieldText != null) {
- composite= new Composite(composite, SWT.NONE);
- layout= new GridLayout(1, false);
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- composite.setLayout(layout);
- gd= new GridData(GridData.FILL_BOTH);
- composite.setLayoutData(gd);
- composite.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- composite.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- }
-
- // Source viewer
- fViewer= new SourceViewer(composite, null, style);
- fViewer.configure(new SourceViewerConfiguration());
- fViewer.setEditable(false);
-
- fText= fViewer.getTextWidget();
- gd= new GridData(GridData.BEGINNING | GridData.FILL_BOTH);
- fText.setLayoutData(gd);
- fText.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- fText.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- fText.setFont(JFaceResources.getFont(symbolicFontName));
-
- fText.addKeyListener(new KeyListener() {
-
- public void keyPressed(KeyEvent e) {
- if (e.character == 0x1B) // ESC
- fShell.dispose();
- }
-
- public void keyReleased(KeyEvent e) {}
- });
-
- // Status field
- if (statusFieldText != null) {
-
- // Horizontal separator line
- fSeparator= new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.LINE_DOT);
- fSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Status field label
- fStatusField= new Label(composite, SWT.RIGHT);
- fStatusField.setText(statusFieldText);
- Font font= fStatusField.getFont();
- FontData[] fontDatas= font.getFontData();
- for (int i= 0; i < fontDatas.length; i++)
- fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10);
- fStatusTextFont= new Font(fStatusField.getDisplay(), fontDatas);
- fStatusField.setFont(fStatusTextFont);
- GridData gd2= new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
- fStatusField.setLayoutData(gd2);
-
- // Regarding the color see bug 41128
- fStatusField.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
-
- fStatusField.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- }
-
- addDisposeListener(this);
- }
-
- /*
- * @see org.eclipse.jface.text.IInformationControlExtension2#setInput(java.lang.Object)
- */
- public void setInput(Object input) {
- if (input instanceof String)
- setInformation((String)input);
- else
- setInformation(null);
- }
-
- /*
- * @see IInformationControl#setInformation(String)
- */
- public void setInformation(String content) {
- if (content == null) {
- fViewer.setInput(null);
- return;
- }
-
- IDocument doc= new Document(content);
- fViewer.setInput(doc);
- }
-
- /*
- * @see IInformationControl#setVisible(boolean)
- */
- public void setVisible(boolean visible) {
- fShell.setVisible(visible);
- }
-
- /*
- * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
- */
- public void widgetDisposed(DisposeEvent event) {
- if (fStatusTextFont != null && !fStatusTextFont.isDisposed())
- fStatusTextFont.dispose();
-
- fStatusTextFont= null;
- fShell= null;
- fText= null;
- }
-
- /*
- * @see org.eclipse.jface.text.IInformationControl#dispose()
- */
- public final void dispose() {
- if (fShell != null && !fShell.isDisposed())
- fShell.dispose();
- else
- widgetDisposed(null);
- }
-
- /*
- * @see IInformationControl#setSize(int, int)
- */
- public void setSize(int width, int height) {
-
- if (fStatusField != null) {
- GridData gd= (GridData)fViewer.getTextWidget().getLayoutData();
- Point statusSize= fStatusField.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- Point separatorSize= fSeparator.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- gd.heightHint= height - statusSize.y - separatorSize.y;
- }
- fShell.setSize(width, height);
-
- if (fStatusField != null)
- fShell.pack(true);
- }
-
- /*
- * @see IInformationControl#setLocation(Point)
- */
- public void setLocation(Point location) {
- Rectangle trim= fShell.computeTrim(0, 0, 0, 0);
- Point textLocation= fText.getLocation();
- location.x += trim.x - textLocation.x;
- location.y += trim.y - textLocation.y;
- fShell.setLocation(location);
- }
-
- /*
- * @see IInformationControl#setSizeConstraints(int, int)
- */
- public void setSizeConstraints(int maxWidth, int maxHeight) {
- fMaxWidth= maxWidth;
- fMaxHeight= maxHeight;
- }
-
- /*
- * @see IInformationControl#computeSizeHint()
- */
- public Point computeSizeHint() {
- Point size= fShell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- size.x= Math.min(size.x, fMaxWidth);
- size.y= Math.min(size.y, fMaxHeight);
- return size;
- }
-
- /*
- * @see IInformationControl#addDisposeListener(DisposeListener)
- */
- public void addDisposeListener(DisposeListener listener) {
- fShell.addDisposeListener(listener);
- }
-
- /*
- * @see IInformationControl#removeDisposeListener(DisposeListener)
- */
- public void removeDisposeListener(DisposeListener listener) {
- fShell.removeDisposeListener(listener);
- }
-
- /*
- * @see IInformationControl#setForegroundColor(Color)
- */
- public void setForegroundColor(Color foreground) {
- fText.setForeground(foreground);
- }
-
- /*
- * @see IInformationControl#setBackgroundColor(Color)
- */
- public void setBackgroundColor(Color background) {
- fText.setBackground(background);
- }
-
- /*
- * @see IInformationControl#isFocusControl()
- */
- public boolean isFocusControl() {
- return fText.isFocusControl();
- }
-
- /*
- * @see IInformationControl#setFocus()
- */
- public void setFocus() {
- fShell.forceFocus();
- fText.setFocus();
- }
-
- /*
- * @see IInformationControl#addFocusListener(FocusListener)
- */
- public void addFocusListener(FocusListener listener) {
- fText.addFocusListener(listener);
- }
-
- /*
- * @see IInformationControl#removeFocusListener(FocusListener)
- */
- public void removeFocusListener(FocusListener listener) {
- fText.removeFocusListener(listener);
- }
-
- /*
- * @see IInformationControlExtension#hasContents()
- */
- public boolean hasContents() {
- return fText.getCharCount() > 0;
- }
-}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/images/collapsed.gif b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/images/collapsed.gif
deleted file mode 100644
index 5f4c8bba4..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/images/collapsed.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/images/expanded.gif b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/images/expanded.gif
deleted file mode 100644
index ff4d9c4a9..000000000
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/images/expanded.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.jface.text/scripts/exportplugin.xml b/org.eclipse.jface.text/scripts/exportplugin.xml
deleted file mode 100644
index 9db702b0f..000000000
--- a/org.eclipse.jface.text/scripts/exportplugin.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<project name="Export JFace Text" default="export" basedir="..">
- <target name="init">
- <tstamp/>
- <property name="destdir" value="../../plugin-export" />
- <property name="plugin" value="org.eclipse.jface.text" />
- <property name="version" value="_3.0.0" />
- <property name="dest" value="${destdir}/${plugin}${version}" />
- </target>
-
- <target name="build" depends="init">
- <eclipse.incrementalBuild project="${plugin}" kind="incr"/>
- </target>
-
- <target name="export" depends="build">
- <mkdir dir="${destdir}" />
- <delete dir="${dest}" />
- <mkdir dir="${dest}" />
- <jar
- jarfile="${dest}/jfacetext.jar"
- basedir="bin"
- />
- <copy file="plugin.xml" todir="${dest}"/>
- <copy file="plugin.properties" todir="${dest}"/>
- <zip zipfile="${dest}/jfacetextsrc.zip">
- <fileset dir="src" />
- <fileset dir="projection"/>
- </zip>
- </target>
-</project>
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/contentassist/AbstractControlContentAssistSubjectAdapter.java b/org.eclipse.jface.text/src/org/eclipse/jface/contentassist/AbstractControlContentAssistSubjectAdapter.java
deleted file mode 100644
index 7ba696481..000000000
--- a/org.eclipse.jface.text/src/org/eclipse/jface/contentassist/AbstractControlContentAssistSubjectAdapter.java
+++ /dev/null
@@ -1,823 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jface.contentassist;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.VerifyKeyListener;
-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.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.graphics.Region;
-import org.eclipse.swt.widgets.Combo;
-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.Text;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.viewers.ILabelProvider;
-
-import org.eclipse.jface.text.IEventConsumer;
-
-
-/**
- * An <code>AbstractControlContentAssistSubjectAdapter</code> delegates assistance requests from a
- * {@linkplain org.eclipse.jface.text.contentassist.ContentAssistant content assistant}
- * to a <code>Control</code>.
- *
- * A visual affordance can be configured via {@link #setContentAssistCueProvider(ILabelProvider)}.
- *
- * @since 3.0
- */
-public abstract class AbstractControlContentAssistSubjectAdapter implements IContentAssistSubjectControl {
-
- protected static final boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jface.text/debug/ContentAssistSubjectAdapters")); //$NON-NLS-1$//$NON-NLS-2$
-
- /**
- * VerifyKeyListeners for the control.
- */
- private List fVerifyKeyListeners;
- /**
- * KeyListeners for the control.
- */
- private Set fKeyListeners;
- /**
- * The Listener installed on the control which passes events to
- * {@link #fVerifyKeyListeners fVerifyKeyListeners} and {@link #fKeyListeners fKeyListeners}.
- */
- private Listener fControlListener;
-
- /**
- * Creates a new {@link AbstractControlContentAssistSubjectAdapter}.
- **/
- public AbstractControlContentAssistSubjectAdapter() {
- fVerifyKeyListeners= new ArrayList(1);
- fKeyListeners= new HashSet(1);
- }
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContentAssistSubjectControl#getControl()
- */
- public abstract Control getControl();
-
- /*
- * @see org.eclipse.jface.text.contentassist.IContentAssistSubjectControl#addKeyListener(org.eclipse.swt.events.KeyListener)
- */
- public void addKeyListener(KeyListener keyListener) {
- fKeyListeners.add(keyListener);
-
- if (DEBUG)
- System.out.println("AbstractControlContentAssistSubjectAdapter#addKeyListener()"); //$NON-NLS-1$
-
- installControlListener();
- }
-
- /**
- * {@inheritDoc}
- */
- public void removeKeyListener(KeyListener keyListener) {
- boolean deleted= fKeyListeners.remove(keyListener);
-
- if (DEBUG) {
- if (!deleted)
- System.out.println("removeKeyListener -> wasn't here"); //$NON-NLS-1$
- System.out.println("AbstractControlContentAssistSubjectAdapter#removeKeyListener() -> " + fKeyListeners.size()); //$NON-NLS-1$
- }
-
- uninstallControlListener();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean supportsVerifyKeyListener() {
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean appendVerifyKeyListener(final VerifyKeyListener verifyKeyListener) {
- fVerifyKeyListeners.add(verifyKeyListener);
-
- if (DEBUG)
- System.out.println("AbstractControlContentAssistSubjectAdapter#appendVerifyKeyListener() -> " + fVerifyKeyListeners.size()); //$NON-NLS-1$
-
- installControlListener();
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean prependVerifyKeyListener(final VerifyKeyListener verifyKeyListener) {
- fVerifyKeyListeners.add(0, verifyKeyListener);
-
- if (DEBUG)
- System.out.println("AbstractControlContentAssistSubjectAdapter#prependVerifyKeyListener() -> " + fVerifyKeyListeners.size()); //$NON-NLS-1$
-
- installControlListener();
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public void removeVerifyKeyListener(VerifyKeyListener verifyKeyListener) {
- fVerifyKeyListeners.remove(verifyKeyListener);
-
- if (DEBUG)
- System.out.println("AbstractControlContentAssistSubjectAdapter#removeVerifyKeyListener() -> " + fVerifyKeyListeners.size()); //$NON-NLS-1$
-
- uninstallControlListener();
- }
-
- /**
- * {@inheritDoc}
- */
- public void setEventConsumer(IEventConsumer eventConsumer) {
- // this is not supported
- if (DEBUG)
- System.out.println("AbstractControlContentAssistSubjectAdapter#setEventConsumer()"); //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLineDelimiter() {
- return System.getProperty("line.separator"); //$NON-NLS-1$
- }
-
- /**
- * Installs <code>fControlListener</code>, which handles VerifyEvents and KeyEvents by
- * passing them to <code>fVerifyKeyListeners</code> and <code>fKeyListeners</code>.
- */
- private void installControlListener() {
- if (DEBUG)
- System.out.println("AbstractControlContentAssistSubjectAdapter#installControlListener() -> k: " + fKeyListeners.size() + ", v: " + fVerifyKeyListeners.size()); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (fControlListener != null)
- return;
-
- fControlListener= new Listener() {
- public void handleEvent(Event e) {
- if (! getControl().isFocusControl())
- return; //SWT.TRAVERSE_MNEMONIC events can also come in to inactive widgets
- VerifyEvent verifyEvent= new VerifyEvent(e);
- KeyEvent keyEvent= new KeyEvent(e);
- switch (e.type) {
- case SWT.Traverse :
-
- if (DEBUG)
- dump("before traverse", e, verifyEvent); //$NON-NLS-1$
-
- verifyEvent.doit= true;
- for (Iterator iter= fVerifyKeyListeners.iterator(); iter.hasNext(); ) {
- ((VerifyKeyListener) iter.next()).verifyKey(verifyEvent);
- if (! verifyEvent.doit) {
- e.detail= SWT.TRAVERSE_NONE;
- e.doit= true;
- if (DEBUG)
- dump("traverse eaten by verify", e, verifyEvent); //$NON-NLS-1$
- return;
- }
-
- if (DEBUG)
- dump("traverse ok", e, verifyEvent); //$NON-NLS-1$
- }
- break;
-
- case SWT.KeyDown:
- for (Iterator iter= fVerifyKeyListeners.iterator(); iter.hasNext(); ) {
- ((VerifyKeyListener) iter.next()).verifyKey(verifyEvent);
- if (! verifyEvent.doit) {
- e.doit= verifyEvent.doit;
- if (DEBUG)
- dump("keyDown eaten by verify", e, verifyEvent); //$NON-NLS-1$
- return;
- }
- }
-
- if (DEBUG)
- dump("keyDown ok", e, verifyEvent); //$NON-NLS-1$
-
- for (Iterator iter= fKeyListeners.iterator(); iter.hasNext();) {
- ((KeyListener) iter.next()).keyPressed(keyEvent);
- }
- break;
-
- default :
- Assert.isTrue(false);
- }
- }
-
- /**
- * Dump the given events to "standard" output.
- *
- * @param who who dump's
- * @param e the event
- * @param ve the verify event
- */
- private void dump(String who, Event e, VerifyEvent ve) {
- StringBuffer sb= new StringBuffer("--- [AbstractControlContentAssistSubjectAdapter]\n"); //$NON-NLS-1$
- sb.append(who);
- sb.append(" - e: keyCode="+e.keyCode+hex(e.keyCode)); //$NON-NLS-1$
- sb.append("; character="+e.character+hex(e.character)); //$NON-NLS-1$
- sb.append("; stateMask="+e.stateMask+hex(e.stateMask)); //$NON-NLS-1$
- sb.append("; doit="+e.doit); //$NON-NLS-1$
- sb.append("; detail="+e.detail+hex(e.detail)); //$NON-NLS-1$
- sb.append("; widget="+e.widget); //$NON-NLS-1$
- sb.append("\n"); //$NON-NLS-1$
- sb.append(" verifyEvent keyCode="+e.keyCode+hex(e.keyCode)); //$NON-NLS-1$
- sb.append("; character="+e.character+hex(e.character)); //$NON-NLS-1$
- sb.append("; stateMask="+e.stateMask+hex(e.stateMask)); //$NON-NLS-1$
- sb.append("; doit="+ve.doit); //$NON-NLS-1$
- sb.append("; widget="+e.widget); //$NON-NLS-1$
- System.out.println(sb);
- }
-
- private String hex(int i) {
- return "[0x" + Integer.toHexString(i) + ']'; //$NON-NLS-1$
- }
- };
- getControl().addListener(SWT.Traverse, fControlListener);
- getControl().addListener(SWT.KeyDown, fControlListener);
-
- if (DEBUG)
- System.out.println("AbstractControlContentAssistSubjectAdapter#installControlListener() - installed"); //$NON-NLS-1$
- }
-
- /**
- * Uninstalls <code>fControlListener</code> iff there are no <code>KeyListener</code>s and no
- * <code>VerifyKeyListener</code>s registered.
- * Otherwise does nothing.
- */
- private void uninstallControlListener() {
- if (fControlListener == null || fKeyListeners.size() + fVerifyKeyListeners.size() != 0) {
-
- if (DEBUG)
- System.out.println("AbstractControlContentAssistSubjectAdapter#uninstallControlListener() -> k: " + fKeyListeners.size() + ", v: " + fVerifyKeyListeners.size()); //$NON-NLS-1$ //$NON-NLS-2$
-
- return;
- }
- getControl().removeListener(SWT.Traverse, fControlListener);
- getControl().removeListener(SWT.KeyDown, fControlListener);
- fControlListener= null;
-
- if (DEBUG)
- System.out.println("AbstractControlContentAssistSubjectAdapter#uninstallControlListener() - done"); //$NON-NLS-1$
- }
-
- /**
- * Sets the visual affordance provider for content assist.
- * The given {@link ILabelProvider} methods are called with
- * {@link #getControl()} as argument.
- *
- * <ul>
- * <li><code>getImage(Object)</code> provides the visual cue image.
- * The image can maximally be 5 pixels wide and 8 pixels high.
- * If <code>getImage(Object)</code> returns <code>null</code>, a default image is used.
- * </li>
- * <li><code>getText(Object)</code> provides the hover info text.
- * It is shown when hovering over the cue image or the adapted {@link Control}.
- * No info text is shown if <code>getText(Object)</code> returns <code>null</code>.
- * </li>
- * </ul>
- * <p>
- * The given {@link ILabelProvider} becomes owned by the {@link AbstractControlContentAssistSubjectAdapter},
- * i.e. it gets disposed when the adapted {@link Control} is disposed
- * or when another {@link ILabelProvider} is set.
- * </p>
- *
- * @param labelProvider a {@link ILabelProvider}, or <code>null</code>
- * if the affordance should not be shown
- */
- public void setContentAssistCueProvider(ILabelProvider labelProvider) {
- SmartFieldController.setSmartCue(getControl(), labelProvider);
- }
-
- /**
- * The internal controller for cues and error messages on <code>Text</code> and
- * <code>Combo</code> <code>Control</code>s.
- */
- private static class SmartFieldController {
-
- /**
- * An info Hover to display a message next to a {@link Control}.
- */
- class Hover {
- /**
- * Distance of info hover arrow from left side.
- */
- private int HD= 10;
- /**
- * Width of info hover arrow.
- */
- private int HW= 8;
- /**
- * Height of info hover arrow.
- */
- private int HH= 10;
- /**
- * Margin around info hover text.
- */
- private int LABEL_MARGIN= 2;
- /**
- * This info hover's shell.
- */
- Shell fHoverShell;
- /**
- * The info hover text.
- */
- String fText= ""; //$NON-NLS-1$
-
- Hover(Shell parent) {
- final Display display= parent.getDisplay();
- fHoverShell= new Shell(parent, SWT.NO_TRIM | SWT.ON_TOP | SWT.NO_FOCUS);
- fHoverShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- fHoverShell.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- fHoverShell.addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent pe) {
- pe.gc.drawString(fText, LABEL_MARGIN, LABEL_MARGIN);
- if (!fgCarbon)
- pe.gc.drawPolygon(getPolygon(true));
- }
- });
- fHoverShell.addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
- showHover(null, null);
- }
- });
- }
-
- int[] getPolygon(boolean border) {
- Point e= getExtent();
- if (border) {
- return new int[] { 0,0, e.x-1,0, e.x-1,e.y-1, HD+HW,e.y-1, HD+HW/2,e.y+HH-1, HD,e.y-1, 0,e.y-1, 0,0 };
- } else {
- return new int[] { 0,0, e.x, 0, e.x, e.y, HD+HW,e.y, HD+HW/2,e.y+HH, HD,e.y, 0,e.y, 0,0 };
- }
- }
-
- void dispose() {
- if (!fHoverShell.isDisposed())
- fHoverShell.dispose();
- }
-
- void setVisible(boolean visible) {
- if (visible) {
- if (!fHoverShell.isVisible())
- fHoverShell.setVisible(true);
- } else {
- if (fHoverShell.isVisible())
- fHoverShell.setVisible(false);
- }
- }
-
- void setText(String t) {
- if (t == null)
- t= ""; //$NON-NLS-1$
- if (! t.equals(fText)) {
- Point oldSize= getExtent();
- fText= t;
- fHoverShell.redraw();
- Point newSize= getExtent();
- if (!oldSize.equals(newSize)) {
- Region region= new Region();
- region.add(getPolygon(false));
- fHoverShell.setRegion(region);
- }
- }
- }
-
- boolean isVisible() {
- return fHoverShell.isVisible();
- }
-
- void setLocation(Control control) {
- if (control != null) {
- int h= getExtent().y;
- fHoverShell.setLocation(control.toDisplay(-HD+HW/2, -h-HH+1));
- }
- }
-
- Point getExtent() {
- GC gc= new GC(fHoverShell);
- Point e= gc.textExtent(fText);
- gc.dispose();
- e.x+= LABEL_MARGIN*2;
- e.y+= LABEL_MARGIN*2;
- return e;
- }
- }
-
- /**
- * A single plain HoverHandler is registered for the content assist control.
- * It handles mouse hover events to show/hide the info hover.
- */
- class HoverHandler extends MouseTrackAdapter {
- /**
- * The managing FieldFocusListener.
- */
- FieldFocusListener fFieldFocusListener;
- /**
- * Create a new HoverHandler.
- *
- * @param fieldFocusListener the field focus listener
- */
- HoverHandler(FieldFocusListener fieldFocusListener) {
- fFieldFocusListener= fieldFocusListener;
- }
- /**
- * @inheritDoc
- */
- public void mouseHover(MouseEvent e) {
- handleMouseEvent(e);
- }
- /**
- * @inheritDoc
- */
- public void mouseExit(MouseEvent e) {
- if (isHoverVisible())
- fFieldFocusListener.doHideHover();
- }
- /**
- * Subclasses may extend or reimplement this method.
- * @param e
- */
- void handleMouseEvent(MouseEvent e) {
- fFieldFocusListener.doShowHover();
- }
- }
-
- /**
- * One CueHandler is registered per ancestor control of the content assist control.
- * It paints the visual cue icon and handles mouse hover events to show/hide the info hover.
- */
- class CueHandler extends HoverHandler implements PaintListener {
- /**
- * Create a new CueHandler.
- *
- * @param fieldFocusListener the field focus listener
- */
- CueHandler(FieldFocusListener fieldFocusListener) {
- super(fieldFocusListener);
- }
- /**
- * @inheritDoc
- */
- public void paintControl(PaintEvent e) {
- fFieldFocusListener.paintControl(e);
- }
- /**
- * Updates the hover.
- *
- * @param event the mouse event
- */
- void handleMouseEvent(MouseEvent event) {
- fFieldFocusListener.updateHoverOnCue(event);
- }
- }
-
- class FieldFocusListener implements FocusListener {
- /**
- * Put icon relative to this control.
- */
- private Control fControl;
- /**
- * The icon's horizontal screen distance from top-left corner of control (in pixels).
- */
- private int fDx;
- /**
- * The icon's vertical screen distance from top-left corner of control (in pixels).
- */
- private int fDy;
- /**
- * The HoverHandler (only when control has focus).
- */
- private HoverHandler fHoverHandler;
-
- /**
- * Create a new FieldFocusListener
- * @param control the target control
- */
- FieldFocusListener(Control control) {
- fControl= control;
-
- fDx= -5;
- fDy= 1;
- if (fgCarbon) {
- if (control instanceof Text) {
- fDy+= 3;
- } else if (control instanceof Combo) {
- fDx-= 4;
- }
- } else if (fgWin32) {
- if (control instanceof Text) {
- fDx-= 2;
- fDy-= 2;
- }
- }
- }
-
- /**
- * Paint the cue image.
- * @param e the PaintEvent
- */
- void paintControl(PaintEvent e) {
- if (fControl.isDisposed())
- return;
- Image image= getCueImage(fControl);
- Point global= fControl.toDisplay(fDx, fDy);
- Point local= ((Control) e.widget).toControl(global);
- e.gc.drawImage(image, local.x, local.y);
- }
-
- /**
- * Show/hide the hover.
- * @param e the MouseEvent
- */
- void updateHoverOnCue(MouseEvent e) {
- Image image= getCueImage(fControl);
- Rectangle r= image.getBounds();
- Point global= fControl.toDisplay(fDx, fDy);
- Point local= ((Control) e.widget).toControl(global);
- r.x= local.x;
- r.y= local.y;
- if (r.contains(e.x, e.y))
- doShowHover();
- else
- doHideHover();
- }
-
- /**
- * Hide hover.
- */
- private void doHideHover() {
- showHover(fControl, null);
- }