Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.ui.editors')
-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
118 files changed, 0 insertions, 21930 deletions
diff --git a/org.eclipse.ui.editors/.classpath b/org.eclipse.ui.editors/.classpath
deleted file mode 100644
index 065ac06e1..000000000
--- a/org.eclipse.ui.editors/.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.ui.editors/.cvsignore b/org.eclipse.ui.editors/.cvsignore
deleted file mode 100644
index c5e82d745..000000000
--- a/org.eclipse.ui.editors/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/org.eclipse.ui.editors/.project b/org.eclipse.ui.editors/.project
deleted file mode 100644
index 6c81c4813..000000000
--- a/org.eclipse.ui.editors/.project
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.ui.editors</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.core.filebuffers</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.core.runtime.compatibility</project>
- <project>org.eclipse.jface.text</project>
- <project>org.eclipse.ui</project>
- <project>org.eclipse.ui.ide</project>
- <project>org.eclipse.ui.workbench.texteditor</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.ui.editors/_buildnotes_text_2_0.html b/org.eclipse.ui.editors/_buildnotes_text_2_0.html
deleted file mode 100644
index f20e33465..000000000
--- a/org.eclipse.ui.editors/_buildnotes_text_2_0.html
+++ /dev/null
@@ -1,971 +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">
- <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
- <meta name="Author" content="IBM">
- <title>Eclipse Platform Release Notes - Desktop</title>
-</head>
-<body>
-
-<h1>
-Eclipse Platform Build Notes</h1>
-
-<h1>
-Text Editor Support (including JFace Text)</h1>
-
-<p><br>Eclipse SDK Build 20020601
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Introduced the concept of setRedraw(boolean) on text viewers. See ITextViewerExtension.setRedraw(boolean).
-This allows to avoid any UI updating while manipulating the viewer's document.
-While redraw == false, the viewer selection is still available, i.e. setSelectedRange
-and getSelectedRange can be used and always refer to the actual state of
-the viewer's document. However, no selection change event and no view port
-changes are sent out. TextEvent (See ITextListener) has been extented to
-carry the viewer's redraw flag.</li>
-
-<li>
-Introduced the concept of&nbsp; a "sequential rewrite mode" on documents.
-See IDocumentExtension. This informs a document about an upcoming sequence
-of non-overlapping consecutive replace commands. If capable the document
-can use this information to operate on an optimized text store. In JFace
-Text, Document operates on a SequentialRewriteTextStore during this period.</li>
-
-<li>
-Reworked text shifting, line delimiter conversion, and find/replace to
-use the newly introduced concepts.</li>
-
-<li>
-Reworked the reactivation behavior of text hovers.</li>
-
-<li>
-Pushed text hover information computation in a background thread.</li>
-
-<li>
-Reactivated and extended the concept of widget token management. See IWidgetTokenOwner,
-IWidgetTokenKeeper.</li>
-
-<li>
-Extended text operations so that they can externally be enabled/disabled.
-See ITextOperationTargetExtension. Currently, this is only used for content
-assist in the source viewer. All other text operations ignore the enable
-flag.</li>
-
-<li>
-Improved incremental search behavior.</li>
-
-<li>
-Further code cleanup.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-See bugzilla.
-<p>
-<hr WIDTH="100%">
-<br>Eclipse SDK Build 20020517
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-The ruler context menu action are initialized correctly when invoked over
-keyboard shortcut. (Ctrl+W)</li>
-
-<li>
-Added delete line actions ([Esc 0] Ctrl+K with emacs key bindings) to text
-editor</li>
-
-<li>
-Added support for setting/clearing/swapping a mark (emacs style selection)</li>
-
-<li>
-Code Cleanup</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-See bugzilla.
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020514
-<h2>
-Breaking API changes</h2>
-IVerticalRulerInfo.addMouseListener/removeMouseListener have been removed
-again. The vertical ruler now provides a control that shares its listeners
-with its children.
-<p>IDocumentProviderExtension.getStatus(Object element) returns an IStatus
-connected with the given element. The status can be used to relate any
-relevant kind of status information with an element for which a provider
-manages a document.
-<h2>
-Other highlights</h2>
-Introduced a StatusTextEditor. The status text editor checks the status
-flag managed for its input element by the editor' document provider. If
-the status is not-OK, a different control is shown. By default an InfoForm
-is shown. Subclasses can change what is shown or subclass InfoForm.
-<p>StorageDocumentProvider and FileDocumentProvider honor the workbench's
-encoding settings. In addition, encoding support is provided by standard
-text editor. File can be viewed using different encodings. Save always
-uses the workbench's encoding setting. Custom editors can leverage the
-support by including the EncodingActionGroup into their menus. The encoding
-support uses the newly introduced status text editor.
-<p>Text hover timeout when typing has been improved. It's now always 1500ms.
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-See bugzilla.
-<br>&nbsp;
-<p>
-<hr WIDTH="100%">
-<br>&nbsp;
-<br>&nbsp;
-<p>Eclipse SDK Build 20020508
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-The context menu of the vertical ruler can be opened with Ctrl+W when using
-the default key binding. Accelerator for the emac's key binding is still
-to be defined.</li>
-
-<li>
-Added support for composite vertical ruler. See CompositeVerticalRuler.&nbsp;
-A composite vertical ruler is configured with ruler columns. Two ruler
-columns are provided by default: AnnotationRulerColumn and LineNumberRulerColumn.</li>
-
-<li>
-Performance changes to the reconciling mechanism in JFace Text.</li>
-
-<li>
-Changes in handling read only files: All modifying text actions are disabled
-by default.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#15071 convert line delimiters - one os missing
-<br>&nbsp;
-<p>
-<hr WIDTH="100%">
-<br>&nbsp;
-<p>Eclipse SDK Build 20020430
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Introduced the concepts of state dependent actions, i.e. actions which
-change their enabling state depending on whether the editor's input is
-read only or not.</li>
-
-<li>
-Added line delimiter conversion actions for DOS, UNIX and Mac.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020423
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Viewport clipping in the vertical ruler</li>
-
-<li>
-Improved painting of range indicator</li>
-
-<li>
-Fixed problem in position handling in AbstractDocument</li>
-
-<li>
-Improved handling of delete in GapTextStore</li>
-
-<li>
-Changes in partition parsing: Introduced the concept of a partition token
-scanner which can resume scanning in the middle of&nbsp; token range.&nbsp;
-The basic assumption is that partition delimiters don't contain line delimiters.
-Partition token scanners can be built with rules implementing IPredicateRule.
-A predicate rule can start evaluation between their start and end sequence.
-PatternRule has been adapted.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020418
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Added method <i>undelete</i> to Position.</li>
-
-<li>
-AbstractMarkerAnnotationModel better supports heterogenous sets of annotations.</li>
-
-<li>
-DefaultUndoManager causes selection changes when executing undo/redo to
-ensure correct enabling/disabling of selection dependent actions.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020411
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Enabled annotation models for more fine grained change notification</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#13358 incremental find: displays little squares after you press 'delete'
-<br>#13283 Find/Replace: Close button too small
-<br>#13459 Typing tab with selection in middle of line shifts right
-<p>
-<hr WIDTH="100%">
-<br>&nbsp;
-<br>&nbsp;
-<p>Eclipse SDK Build 20020409
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Added support for external contribution of ruler actions. I.e. plugins
-can contribute actions to the context menu of an editor's vertical ruler&nbsp;
-by specifying those actions in their plugin.xml file.</li>
-
-<li>
-In the default key binding Ctrl+ArrowUp and Ctrl+ArrowDown are bound to
-scroll a single line without moving the cursor.</li>
-
-<li>
-AnnotationModel is be used from several threads.</li>
-
-<li>
-TextViewer implements ITextViewerExtensions which supports the stacking
-of VerifyKeyListeners. A listener that is prepended to the list of verify
-key listeners can take over the control over all key strokes not bound
-as menu item accelerators.</li>
-
-<li>
-The scheme according to which an editor calls Workspace.validateEdit has
-been reworked.</li>
-
-<li>
-The editor hooks to the Revert action in the File menu.</li>
-
-<li>
-AbstractTextEditor supports property dependent actions similar to selection
-or content dependent actions.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#11215 Editor task creation actions should use TaskPropertiesDialog
-<br># 9761 Line has to be selected from beginning when using the 'Tab'
-<br>#10806 call validateEdit() again before any further changes
-<br>#11480 READ/WRITE not updated on focus change
-<br>#12901 P2 Find/Replace should keep last selection highlighted
-<p>
-<hr WIDTH="100%">
-<br>&nbsp;
-<p>Eclipse SDK Build 20020402
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-fixed a problem in the TextViewer's handleDipose method</li>
-
-<li>
-AbstractMarkerAnnotationModel can now deal with a heterogenous set of annotations</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020326
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Enabled key binding support</li>
-
-<li>
-dialog-less incremental search (improvements)</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<br>&nbsp;
-<p>Eclipse SDK Build 20020318
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-All find operations can be limited to a scope using the find replace dialog.
-Multi-line selections serve as scope.</li>
-
-<li>
-Emacs-like incremental search (Ctrl-J) is now part of AbstractTextEditor.</li>
-
-<li>
-Preparations for key binding support</li>
-
-<br>&nbsp;</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#2280 Undo does not jump to undone location (1GEK1G5)
-<br>#7381 Search results block hover help for problems
-<br>#7954 Content assist off the edge of the display
-<br>#10141 Shift Left/Right disabled unless selection is "full lines".
-<br>#11047 Index out of bounds on text hover
-<br>#11148 Syntax coloring lost on revert
-<br>#11377 Code assist leaks threads
-<br>#11433 NPE opening editor when some plugins disabled
-<br>&nbsp;
-<br>&nbsp;
-<p>
-<hr WIDTH="100%">
-<br>&nbsp;
-<p>Eclipse SDK Build 20020312
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-All editors based on AbstractTextEditor now support <i>Find Next</i> and
-<i>Find
-Previous. </i>Both actions are selection aware, i.e. having a word selected
-when invoking <i>Find Next </i>searches for the next appearance of the
-selected word.</li>
-
-<li>
-A first cut of incremental search is implemented accessible via the Find/Replace
-dialog.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#5191 EC DCR: Add keyboard accelerator for "Find Next"
-<br>#5710 Emacs-like isearch (aka "incremental search")
-<br>#10489 Indention a template results in NPE
-<br>#2698 Opening Default Text Editor not showing right icon in the file
-tab (1GI7GK2)
-<br>#7954 Content assist off the edge of the display
-<br>#9964&nbsp; nor P3 Syntax highlight and comments bug
-<br>#11047&nbsp; nor P2 Index out of bounds on text hover
-<br>&nbsp;
-<p>
-<hr WIDTH="100%">
-<br>&nbsp;
-<p>Eclipse SDK Build 20020305
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#8652 ctl-space doesn't wrk for content assist in Java editor when
-<br>#8910 @link-tag in Javadoc display broken
-<br>#9576 Method argument hints not as smart as code assist
-<br>#10315 Syntax highlighting glitch
-<br>#10422 Incorrect syntax highlighting for comments
-<br>#10721 Syntax highlighting lost in Java editor after replace with r
-<br>&nbsp;
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020212
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Added IContextInformationExtension to support context information positions
-not equal to completion position (related to #4366).</li>
-
-<li>
-Added preference store keys for system default background/foreground colors
-(related to #5811).</li>
-
-<li>
-Reworked handling of read-only resources and state changes of resources.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#2635 Find should remember last string if selection empty (1GHFMYL
-<br>#5380 Error hover doesn't appear
-<br>#7483 NPE during revert in Java editor
-<br>#2575 [JFace Text] BUG - org.eclipse.ui.texteditor inconsistency (1GGLRU6)
-<br>#5969 Find dialog placement needs improvement
-<br>#5811 Pref to set editor background color
-<br>#5819 Code formatter doesn't work well with else if on next line
-<br>&nbsp;
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020129
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#5819 Code formatter doesn't work well with else if on next line
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020122
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#4324 EC: Find/replace gets stuck in infinite loop (1GLCBZE)
-<br>#3736 DCR: Go to line - would be nice to show valid range (1GEHSDX)
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020115
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#4335 Find/Replace should come up with first history entry (1GEL5NS)
-<br>#4338 Find/change history is never pruned (1GHDUJW)
-<br>#4342 TextViewer.setTopIndex doesn't take horizontal scrollbar into
-account (1GIFYC7)
-<br>#4343 Text hidden inserted by code assist (1GJ9PGK)
-<br>#6701 Code assist: java hint not properly aligned
-<br>#6379 StatusLine 'Writeable' is not readable
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20020108
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#3833 Javadoc hover appears under code assist window (1GF0K3T)
-<br>#4363 Two Java Doc hovers
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20011218
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#1614 Current line in Debugger should start at center of source ed
-<br>#5000 Context menu IDs not fully qualified
-<br>#5959 Text editor: SEVERE - Revert should be undoable
-<br>#6075 NPE while editing in compare view
-<br>#6318 F2 window accessability issues
-<br>#4367 Argument hover doesn't work for nested method call
-<br>#4964 Automatic Code Assist needs to be smarter
-<br>#4966 Automatic Code Assist needs to be smarter #2
-<br>#4967 Automatic Code Assist needs to be smarter #3
-<br>#4968 Automatic Code Assist needs to be smarter #4
-<br>#4969 Automatic Code Assist needs to be smarter #5
-<br>#4999 Automatic Code Assist needs to be smarter #7
-<br>#6589 ctrl+insert, shift+insert incorrectly flips the insert/overw
-<br>#3467 Horizontal scrolling when stepping through errors (1GE6AF1)
-<br>#4041 out of sync error message after copying resources (1GGR6VZ)
-<br>#6699 Save should not flush undo stack
-<br>#4071 Format option loses place in editor (1GHQFU6)
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20011211
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#1614 Current line in Debugger should start at center of source editor
-(1GETH7J)
-<br>#3467 Horizontal scrolling when stepping through errors (1GE6AF1)
-<p>
-<hr WIDTH="100%">
-<br>&nbsp;
-<p>Eclipse SDK Build 20011206
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-Support for read-only but modifiable resources in editors. For this reason
-AbstractTextEditor now calls validateState if its document provider also
-implement IDocumentProviderExtension. The calls are issued:
-<ul>
-<li>
-when an editor is marked dirty</li>
-
-<li>
-when an editor saves its document to its input</li>
-
-<li>
-when a dirty resource is moved (if allowed)</li>
-</ul>
-Calling validateState may cause changes to the isModifiable and isReadOnly
-properties of the editor's input.
-<br>FileDocumentProvider implements validateState by calling IWorkspace.validateEdit
-on the input file.
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20011204
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-Perparations for supporting the concept of read-only but modifiable resources
-in editors.
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#6203 SEVERE: typing in java editor causes OutOfMemoryError in JDK 1.4
-<br>#6263 Extra closing braces inserted
-<p>
-<hr WIDTH="100%">
-<br>&nbsp;
-<p>Eclipse SDK Build 20011127
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-An BasicTextEditorActionContributor now contributes three status fields
-into the window's status line. Each field is dedicated to show information
-of a particular category. The categories are defined in ITextEditorActionConstants.
-A new interface ITextEditorExtension has been introduced. On activation,
-implementing editors of this interface are informed about the status fields
-they can use to publish status information. AbstractTextEditor implements
-ITextEditorExtension. Subclasses of AbstractTextEditor can get access to
-the editor's current status fields using the method getStatusField(String
-category). By default, AbstractTextEditor publishes the following information:
-cursor position, input mode, reade only state of its input. Subclasses
-may change this behavior by overriding updateStatusField(String category)
-or callers of this method.</li>
-
-<li>
-The default text editor uses the feature described above and now provides
-status information.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#4071&nbsp;&nbsp;&nbsp; Format option loses place in editor (1GHQFU6)
-<br>#6168&nbsp;&nbsp;&nbsp; code assist preference (auto complete) does
-not work
-<br>#6087&nbsp;&nbsp;&nbsp; NPE closing content assist from DisplayView
-on exit
-<br>#6013&nbsp;&nbsp;&nbsp; Repeatable Java editor hang in 200111115
-<br>#4947&nbsp;&nbsp;&nbsp; No indication of Insert/Overwrite mode
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20011120
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-Change to AbstractHoverInformationControlManager to reset the hover location
-on a time basis.</li>
-
-<li>
-Added configuration method to ContentAssistant to automatically insert
-a single proposal.</li>
-
-<li>
-Behavioral configuration methods such as enableAutoInsert, enableAutoActivation,
-and setAutoActivationDelay can now be called when after the content assistant
-has been installed.</li>
-
-<li>
-Context information popup recomputes size after style information has been
-applied.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports closed</h2>
-#2569&nbsp;&nbsp;&nbsp; [JFace Text] Content assist list truncated (1GG1W9B)
-<br>#2904&nbsp;&nbsp;&nbsp; [JFace Text] PropagatingFontFieldEditor has
-moved (1GKKL13)
-<br>#1824&nbsp;&nbsp;&nbsp; [JFace Text] 50 reconciling threads for 4 editors
-opened (1GFXMV8)
-<br>&nbsp;
-<p>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 20011101
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-
-<ul>
-<li>
-introduction of setDocumentContent(IDocument, IEditorInput) on StorageDocumentProvider.</li>
-
-<li>
-introduction of IDocumentExtension (see JavaDoc)</li>
-
-<li>
-AbstractDocument implements IDocumentExtension</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-Instances of DefaultInformationControl are wider than necessary.
-<h2>
-Problem reports fixed</h2>
-
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 206
-<h2>
-Breaking API changes</h2>
-Corrected spelling of&nbsp; "anchor" in AbstractInformationControlManager
-and its subclasses.
-<h2>
-Other highlights</h2>
-
-<h2>
-Known deficiencies</h2>
-Instances of DefaultInformationControl are wider than necessary.
-<h2>
-Problem reports fixed</h2>
-<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=5066">#5066&nbsp;&nbsp;&nbsp;
-Code Assist: Thread created / not removed</a>
-<br><a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=5120">#5120&nbsp;&nbsp;&nbsp;
-Empty popup doc in java editor</a>
-<br><a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=3473">#3473&nbsp;&nbsp;
-mnemonics (1GF25DN)</a>
-<p>
-<hr WIDTH="100%">
-<br>&nbsp;
-<p>Eclipse SDK Build 204
-<h2>
-Breaking API changes</h2>
-
-<h2>
-Other highlights</h2>
-For more information about the following issue please see JavaDoc of the
-classes
-<ul>
-<li>
-Several improvements of the new hover infrastructure, such as customizable
-SWT styles.</li>
-
-<li>
-Improved look of the content assist window.</li>
-
-<li>
-Content assist supports customizable completion characters, i.e. each completion
-proposal can specify which characters trigger its insertion.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-Instances of DefaultInformationControl are wider than necessary.
-<h2>
-Problem reports fixed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<br>&nbsp;
-<p>Eclipse SDK Build 203
-<h2>
-Breaking API changes</h2>
-&nbsp; package:&nbsp;&nbsp; org.eclipse.jface.text
-<br>&nbsp; interface:&nbsp;&nbsp; IHoverInfoPresenter
-<br>&nbsp; change:&nbsp;&nbsp; removed interface
-<br>&nbsp; change type: breaking API change for implementers of IHoverInfoPresenter
-<h2>
-Other highlights</h2>
-For more information about the following issue please see JavaDoc of the
-classes
-<ul>
-<li>
-Complete rework of hover popups (previously a package private mechanism
-hidden from clients). There is now the concept of an IInformationControl
-and an IInformationControlCreator. Everywhere where floating windows are
-used to present some kind of information, now IInformationControl is used.
-More precise, the according component is equiped with an IInformationControlCreator
-and creates the IInformationControl instance when needed. So clients can
-set an IInformationControlCreator on a TextViewer and a SourceViewer. They&nbsp;
-use it&nbsp; to create the text hover window and the annotation bar hover
-window respectively. DefaultInformationControl&nbsp; is a StyledText-based
-default implementation of IInformationControl. Clients may implement IInformationControl
-directly and inject their custom information control creator.</li>
-
-<li>
-AbstractInformationControlManager and its subclasses abstractly&nbsp; implement
-the process of providing a SWT control with support for floating information
-windows. This covers layout, positioning, content, and visibility of the
-floating window. They offer a broad customization space such as layout
-strategies, colors, etc.</li>
-
-<li>
-TextViewer hovers, annotation bar hovers, additional info on completion
-proposals in the content assistant, etc. benefit from the new infrastructure.
-UI improvements are especially visible in the layout behavior.</li>
-
-<li>
-Introduced the concept of an information presenter. An information presenter
-shows information on a context derivved subject on request. See IInformationPresenter
-for details as well as SourceViewer and SourceViewerConfiguration for how
-to use it.</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-Instances of DefaultInformationControl are wider than necessary.
-<h2>
-Problem reports fixed</h2>
-
-<p><br>
-<hr WIDTH="100%">
-<p>Eclipse SDK Build 200
-<h2>
-Breaking API changes</h2>
-&nbsp; package:&nbsp;&nbsp; org.eclipse.jface.text
-<br>&nbsp; interface:&nbsp;&nbsp; ITextViewer
-<br>&nbsp; change:&nbsp;&nbsp; added method public void invalidateTextPresentation(
-)
-<br>&nbsp; change type: breaking API change for implementers of ITextViewer
-<p>&nbsp; package:&nbsp;&nbsp; org.eclipse.jface.text
-<br>&nbsp; interface:&nbsp;&nbsp; ITextViewer
-<br>&nbsp; change:&nbsp;&nbsp; added method public void setDefaultPrefixes(String[]
-defaultPrefixes, String contentType)
-<br>&nbsp; change type: breaking API change for implementers of ITextViewer
-<p>&nbsp; package:&nbsp;&nbsp; org.eclipse.jface.text
-<br>&nbsp; interface:&nbsp;&nbsp; ITextViewer
-<br>&nbsp; change:&nbsp;&nbsp; removed method&nbsp; void setDefaultPrefix(String
-defaultPrefix, String contentType)
-<br>&nbsp; change type: breaking API change for implementers of ITextViewer
-<p>&nbsp; package:&nbsp;&nbsp; org.eclipse.jface.text.rules
-<br>&nbsp; class:&nbsp;&nbsp; RuleBasedDamagerRepairer
-<br>&nbsp; change:&nbsp;&nbsp; deprecated constructor&nbsp; public RuleBasedDamagerRepairer(RuleBasedScanner
-scanner, TextAttribute defaultTextAttribute)
-<br>&nbsp; change type: breaking API change for clients of RuleBasedDamagerRepairer
-<h2>
-Other highlights</h2>
-For more information about the following issue please see JavaDoc of the
-classes
-<ul>
-<li>
-IContextInformationValidator implementers may also implement IContextInformationPresenter
-to style context information</li>
-
-<li>
-ITextHover implementers may also implement IHoverInfoPresenter to style
-hover information</li>
-
-<li>
-PropagatingFontFieldEditor has been introduced</li>
-
-<li>
-MonoReconciler has been introduced to support partition independent reconciling</li>
-
-<li>
-Token has been reimplemented, supports setData method now</li>
-
-<li>
-RuleBasedScanner now supports&nbsp; public void setDefaultReturnToken(IToken
-defaultReturnToken). This token is returned if no rule can fire.</li>
-
-<li>
-TextPresentation now supports&nbsp; public static void applyTextPresentation(TextPresentation
-presentation, StyledText text)</li>
-
-<li>
-BasicMarkerUpdater has been marked as final</li>
-
-<li>
-SelectMarkerRulerAction has been introduced</li>
-
-<li>
-WorkbenchChainedTextFontFieldEditor has been introduced</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<h2>
-Problem reports fixed</h2>
-1GJ65EW: ITPSRCEDIT:WINNT - ResourceMarkerAnnotaionModel: unnecessary fireModelChange
-<br>1GIYR3X: ITPSRCEDIT:ALL - NL: word select (double click) in Java comments
-<br>1GGYYWK: ITPJUI:ALL - Dismissing editor with code assist up causes
-lots of Internal Errors
-<br>1GEUOZ9: ITPJUI:ALL - Confusing UI for multiline Bookmarks and Tasks
-<br>1GII2RZ: ITPJUI:WINNT - AssertionFailed Ex. in Java editor
-<br>1GIYQ9K: ITPUI:WINNT - StyledText swallows Shift+TAB
-<br>1GIJZOO: ITPSRCEDIT:ALL - Gotodialog's edit field has no initial focus
-
-</body>
-</html>
diff --git a/org.eclipse.ui.editors/_buildnotes_text_2_1.html b/org.eclipse.ui.editors/_buildnotes_text_2_1.html
deleted file mode 100644
index f4e50d398..000000000
--- a/org.eclipse.ui.editors/_buildnotes_text_2_1.html
+++ /dev/null
@@ -1,267 +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">
- <meta name="GENERATOR" content="Mozilla/4.76 [en] (Windows NT 5.0; U) [Netscape]">
- <meta name="Author" content="IBM">
- <title>Eclipse Platform Release Notes - Desktop</title>
-</head>
-<body>
-
-<h1>
-Eclipse Platform Build Notes</h1>
-
-<h1>
-Platform Text</h1>
-
-<p><br>Eclipse SDK Build 20030205
-<h2>
-What's new</h2>
-
-<ul>
-<li>
-Added new layout anchor option "GLOBAL" to the AbstractInformationControlManager.
-Information controls that are opened using this anchor are placed in the
-middle of the subject control.</li>
-
-<li>
-Changed all internal usages of SWT defined modifiers to the generic modifiers
-MOD?</li>
-
-<li>
-Moved "Go to Line" action into the Navigate menu</li>
-
-<li>
-The default text editor now supports:</li>
-
-<ul>
-<li>
-line numbers</li>
-
-<li>
-cursor line highlighting</li>
-
-<li>
-overview ruler</li>
-
-<li>
-error annotations</li>
-</ul>
-
-<li>
-The overview ruler can now be configured to show an header. The header
-shows the presence of annotations of a certain type.</li>
-</ul>
-
-<h2>
-Problem reports closed</h2>
-
-<blockquote>See bugzilla.</blockquote>
-
-<hr>
-<p>Eclipse SDK Build 20030128
-<h2>
-What's new</h2>
-
-<ul>
-<li>
-Introduced painter infrastructure at text viewer level. The following predefined
-painters are available:</li>
-
-<ul>
-<li>
-AnnotationPainter</li>
-
-<ul>
-<li>
-represents annotations given in the viewer's annotation model as squiggly
-lines in the text widget</li>
-
-<li>
-can be configured along annotation types and colors</li>
-</ul>
-
-<li>
-CursorLinePainter</li>
-
-<ul>
-<li>
-highlights the background of the current line (i.e. the line in which the
-cursor resides)</li>
-
-<li>
-color can be configured</li>
-</ul>
-
-<li>
-MargingPainter</li>
-
-<ul>
-<li>
-draws a vertical line at a certain column</li>
-
-<li>
-color and column can be configured</li>
-</ul>
-
-<li>
-MatchingCharacterPainter</li>
-
-<ul>
-<li>
-highlights the character matching the character close to the current cursor
-position by drawing a bounding box around the character</li>
-
-<li>
-must be configured with a strategy for finding the matching character (ICharacterPairMatcher)</li>
-
-<li>
-color can be configured</li>
-</ul>
-</ul>
-
-<li>
-Painters can dynamically be attached to a source viewer. API is defined
-in&nbsp; the interface ITextViewerExtension2. The TextViewer manages its
-painters using a PaintManager.</li>
-
-<li>
-Introduced the concept of an overview ruler at the source viewer level.
-The API is defined in the interface ISourceViewerExtension.</li>
-
-<li>
-Introduced a helper class SourceViewerDecorationSupport at the text editor
-framework that can be used by editors to manage and configure painters.
-This includes the initialization of painters from preferences and the reaction
-on preference changes.</li>
-
-<li>
-Changed validateEdit behavior for&nbsp; the find/replace case. validateEdit
-is now called directly in front of the first text replace operation.</li>
-
-<li>
-Global action definition ids have been introduced for computing content
-completion proposals and computing content context information.</li>
-
-<li>
-ITextViewerExtension2 now offers API to remove all registered text hovers
-for a given content type</li>
-</ul>
-
-<h2>
-Problem reports closed</h2>
-
-<blockquote>See bugzilla.</blockquote>
-
-<h1>
-
-<hr></h1>
-Eclipse SDK Build 20030107
-<h2>
-What's new</h2>
-
-<ul>
-<li>
-New attribute&nbsp;<span style="font-weight: bold;">symbolicFontName</span>
-has been added to <tt>org.eclipse.ui.editors</tt> extension point. See
-the extension point documentation for more details. If the attribute is
-provided then the text editors use it as primary source for setting the
-text editor font.</li>
-</ul>
-
-<h2>
-Problem reports closed</h2>
-
-<blockquote>See bugzilla.</blockquote>
-
-<hr>
-<h1>
-Eclipse Platform Build Notes</h1>
-
-<h1>
-Platform Text</h1>
-Eclipse SDK Build 20021203
-<h2>
-What's new</h2>
-
-<ul>
-<li>
-Introduced goto to last edit position</li>
-</ul>
-
-<h2>
-Problem reports closed</h2>
-
-<blockquote>See bugzilla.</blockquote>
-
-<hr>
-<p>Eclipse SDK Build 20021008
-<h2>
-What's new</h2>
-
-<ul>
-<li>
-Introduced smart behavior for Home/End key</li>
-
-<li>
-Infrastructure for eating code assist including visual indication of text
-to be replaced</li>
-</ul>
-
-<h2>
-Problem reports closed</h2>
-
-<blockquote>See bugzilla.</blockquote>
-
-<hr>
-<p>Eclipse SDK Build 20021001
-<h2>
-What's new</h2>
-
-<ul>
-<li>
-Applied patch for incremental search to behave more like Emacs</li>
-
-<li>
-Applied patch for delete line to copy to clipboard (Emacs behaviour)</li>
-</ul>
-
-<h2>
-Problem reports closed</h2>
-
-<blockquote>See bugzilla.</blockquote>
-
-<hr>
-<p>Eclipse SDK Build 20020903
-<h2>
-What's new</h2>
-
-<ul>
-<li>
-Adaptable line number ruler width</li>
-
-<li>
-Resizable content assist proposal popup</li>
-
-<li>
-Pre 2.0 build notes have been moved to buildnotes_text_2_0.html</li>
-</ul>
-
-<h2>
-Known deficiencies</h2>
-
-<ul>
-<li>
-Size of content assist proposal popup is not persisted over session boundaries</li>
-
-<li>
-Size of content assist proposal popup is not editor type specific</li>
-</ul>
-
-<h2>
-Problem reports closed</h2>
-
-<blockquote>See bugzilla.</blockquote>
-
-</body>
-</html>
diff --git a/org.eclipse.ui.editors/about.html b/org.eclipse.ui.editors/about.html
deleted file mode 100644
index 9db411aab..000000000
--- a/org.eclipse.ui.editors/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.ui.editors/build.properties b/org.eclipse.ui.editors/build.properties
deleted file mode 100644
index 80de3b635..000000000
--- a/org.eclipse.ui.editors/build.properties
+++ /dev/null
@@ -1,18 +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
-###############################################################################
-source.editors.jar = src/
-bin.includes = *.jar,\
- plugin.xml,\
- plugin.properties,\
- about.html,\
- icons/
-src.includes = about.html,\
- schema/
diff --git a/org.eclipse.ui.editors/buildnotes_text.html b/org.eclipse.ui.editors/buildnotes_text.html
deleted file mode 100644
index fee88b4f7..000000000
--- a/org.eclipse.ui.editors/buildnotes_text.html
+++ /dev/null
@@ -1,707 +0,0 @@
-<!--
- DO NOT EDIT THIS FILE WITH HTML EDITORS
--->
-
-<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
-<html>
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.76 [en] (Windows NT 5.0; U) [Netscape]">
- <title>Eclipse Platform Build Notes - Text</title>
-</head>
-
-<body>
-<h1>
-Eclipse Platform Build Notes<br>
-Text</h1>
-To see which bugs have been addressed in one of the builds simply open the <a href="http://bugs.eclipse.org/bugs/query.cgi?short_desc_type=allwordssubstr&amp;product=Platform&amp;component=Text&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;keywords_type=allwords&amp;keywords=&amp;emailtype1=substring&amp;email1=&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;namedcmd=Assigned&amp;newqueryname=&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=">Platform-Text bugzilla query page</a>, select status, resolution and the time frame.
-<br>
-<br>
-<br>
-========== Eclipse Build Input May 18th 2004 ==========<br>
-<pre>
-- removed last dependency on compatibility plug-in
-- bug fixing
-
-The infrastructure for collapsing and expanding ranges of lines in editors (referred to as folding)
-is now officially available. The effected plug-ins are org.eclipse.text and org.eclipse.jface.text.
-
-The org.eclipse.text plug-in contains the package org.eclipse.jface.text.projection. This package
-defines the UI independent document infrastructure needed for folding. The center piece is the
-ProjectionDocument. The content of a projection document is a projection of the content of a master
-document. In other words fragments of the master document constitute the segments of the projection
-document. The mapping is enacted by the ProjectionMapping implementing IDocumentInformationMapping.
-After an instance of ProjectionDocument has been created it is initially empty. The content is defined
-by calling addMasterDocumentRange(offsetInMasterDocument, lengthInMasterDocument) and
-removeMasterDocumentRange(offsetInMasterDocument, lengthInMasterDocument). The projection document
-and its master document are causally connected. Thus, any manipulation of the projection document also
-causes master document changes. Any manipulation effecting ranges in the master document that have been
-added to the projection document also cause projection document changes.
-
-The org.eclipse.jface.text plug-in contains the package org.eclipse.jface.text.source.projection.
-This package defines the UI needed for folding based on the projection document infrastructure. The
-center piece is the ProjectionViewer and the ProjectionSupport. A projection support can be installed on
-projection viewer. It controls the existence of a vertical ruler column for collapsing/expanding ranges
-of lines, the hover behavior, and the presentation of collapsed regions in the viewer. The projection viewer
-defines a set of text operations for managing the expansion state of collapsable regions. Collapsable regions
-can be defined by requesting the ProjectionSupport to provide an adapter for ProjectionAnnotationModel.class
-for the viewer it is installed on. The ProjectionAnnotations managed by this projection annotation model
-define the collapsable regions.
-
-ITextViewer defines the concept of a visible region. This concepts is incompatible with folding. Several
-assumptions that were safe to make in the world of visible regions are no longer valid in the presence of folding.
-For example, in order to determine the document line number of the fifth line in the viewer's widget it was
-good enough to determine the start line of the viewer's visible region and to take the fifth line after that.
-When folding is enabled, any number of lines can be between two visible lines. Thus, in order to convert between
-widget and model coordinates, the methods provided by ITextViewerExtension5 should be used.
-
-Editor implementers (based on AbstractTextEditor) who want to support folding have to do the following:
-- override createSourceViewer and return a ProjectionViewer
-- override createPartControl resembling:
-
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
-
- ProjectionViewer projectionViewer= (ProjectionViewer) getSourceViewer();
-
- fProjectionSupport= new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors());
- fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
- fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
- fProjectionSupport.setHoverControlCreator(new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell shell) {
- return new CustomSourceInformationControl(shell, IDocument.DEFAULT_CONTENT_TYPE);
- }
- });
- fProjectionSupport.install();
-
- ...
-
- if (isFoldingEnabled())
- projectionViewer.doOperation(ProjectionViewer.TOOGLE);
- }
-
-- extend getAdapter with
-
- public Object getAdapter(Class required) {
- ...
- if (fProjectionSupport != null) {
- Object adapter= fProjectionSupport.getAdapter(getSourceViewer(), required);
- if (adapter != null)
- return adapter;
- }
-
- return super.getAdapter(required);
- }
-
-- provide a way to allow the definition of collpsable regions such as:
-
- ITextEditor editor= getTextEditor();
- ISelection selection= editor.getSelectionProvider().getSelection();
- if (selection instanceof ITextSelection) {
- ITextSelection textSelection= (ITextSelection) selection;
- if (!textSelection.isEmpty()) {
- IAnnotationModel model= (IAnnotationModel) editor.getAdapter(ProjectionAnnotationModel.class);
- if (model != null) {
- int start= textSelection.getStartLine();
- int end= textSelection.getEndLine();
- try {
- IDocument document= editor.getDocumentProvider().getDocument(editor.getEditorInput());
- int offset= document.getLineOffset(start);
- int endOffset= document.getLineOffset(end + 1);
- Position position= new Position(offset, endOffset - offset);
- model.addAnnotation(new ProjectionAnnotation(), position);
- } catch (BadLocationException x) {
- }
- }
- }
- }
-
-</pre>
-========== Eclipse Build Input May 11th 2004 ==========<br>
-<pre>
-- reworked editor preference pages:
- - Annotations and Quick Diff sub-pages are gone: they are now centralized under
- Workbench > Editors
- - added API which allows to configure a client's preference store to use the
- centralized preference pages:
- see: EditorsUI.useAnnotationsPreferencePage(IPreferenceStore)
- see: EditorsUI.useQuickDiffPreferencePage(IPreferenceStore)
- - added ChainedPreferenceStore which allows to chain preference stores
- - the text editor's Appearance sub-page is now the only Text Editor's preference page
-- removed all but one dependencies on compatibility plug-in
-- externalized all strings
-- bug fixing
-</pre>
-========== Eclipse Build Input May 4th 2004 ==========<br>
-<pre>
-- ICompletionProposalExtension3: renamed methods:
- - getCompletionText -> getPrefixCompletionText
- - getCompletionOffset -> getPrefixCompletionOffset
-
-
-Headless annotation model support for text file buffers:
-
-We added headless annotation model support to text file buffers. Each text
-file buffer can now have its own annotation model.
- ITextFileBuffer buffer= FileBuffers.getTextFileBufferManager().getTextFileBuffer(<location>);
- IAnnotationModel model= buffer.getAnnotationModel();
-When the buffer's document is changed, all annotations in the buffer's annotation
-model are accordingly updated.
-
-As annotations (org.eclipse.jface.text.source.Annotation) had dependencies on
-SWT the following changes have been applied. These changes might break existing 3.0 clients.
-The changes in detail:
-- ImageUtilities has been moved from org.eclipse.ui.texteditors to org.eclipse.jface.text.source
-- removed static Annotation.drawImage methods -> use org.eclipse.jface.text.source.ImageUtilities
-- removed setLayer, getLayer, and paint from Annotation -> annotations which want to draw
- themselves should implement IAnnotationPresentation (as has been introduced by Dec. 18th)
-- MarkerAnnotation now directly implements the methods removed from Annotation (setLayer, getLayer, paint)
-- MarkerAnnotation extends SimpleMarkerAnnotation, SimpleMarkerAnnotation just provides
- access to the represented IMarker
-- the following classes have been moved from the plug-in org.eclipse.jface.text to the plug-in
- org.eclipse.text, the package names remain the same
- org.eclipse.jface.text.ISynchronizable
- org.eclipse.jface.text.source.Annotation
- org.eclipse.jface.text.source.AnnotationMap
- org.eclipse.jface.text.source.AnnotationModel
- org.eclipse.jface.text.source.AnnotationModelEvent
- org.eclipse.jface.text.source.IAnnotationMap
- org.eclipse.jface.text.source.IAnnotationModel
- org.eclipse.jface.text.source.IAnnotationModelExtension
- org.eclipse.jface.text.source.IAnnotationModelListener
- org.eclipse.jface.text.source.IAnnotationModelListenerExtension
-
-The following changes were made to add headless annotation model support to filebuffers.
- - added ITextFileBuffer.getAnnotationModel(IPath)
- - added ITextFileBufferManager.createAnnotationModel(IPath)
- - introduced IPersistableAnnotationModel give annotations model a sense of a life cycle
- - added new extension point org.eclipse.core.filebuffers.annotationModelCreation for
- registering factories for file buffer annotation models
- - introduced IAnnotationModelFactory to reify the contract for the extension point
- - changed TextFileDocumentProvider to take the text file buffer annotation models into
- account. This is only the case when a subclass does override
- TextFileDocumentProvider.createAnnotationModel
-
-Theses changes affect the following plug-ins:
- org.eclipse.core.filebuffers
- org.eclipse.jface.text
- org.eclipse.text
- org.eclipse.ui.editors
-
-</pre>
-<br>
-========== Eclipse Build Input April 27th 2004 ==========<br>
-<pre>
-- Added org.eclipse.ui.contentassist.ContentAssistHandler which can
- be used to install and control enablement of the visual cue and the
- key binding for subject control content assistants.
-</pre>
-<br>
-========== Eclipse Build Input April 20th 2004 ==========<br>
-<pre>
-Open / closed partitions:
-From IDocumentPartitionerExtension2:
-This extension introduces the concept of open and closed (or delimited)
-partitions. A delimited partition has a textual token delimiting its start
-and end, while an open partition can fill any space between two delimited
-partitions.
-An open partition of zero length can occur between two delimited partitions,
-thus having the same offset as the following delimited partition. The
-document start and end are considered to be delimiters of open partitions,
-i.e. there may be a zero-length partition between the document start and a
-closed partition starting at offset 0.
-
-The partition information queries on IDocumentPartitionerExtension2 carry a
-boolean argument that specifies whether such open partitions should be returned.
-
------
-
-API changes:
-
-plug-in: org.eclipse.text
-
-- pkg: org.eclipse.jface.text
- - renamed FindReplaceDocumentAdapter.search to FindReplaceDocumentAdapter.find
- - changed FindReplaceDocumentAdapter.findReplace to private
- - merged FindReplaceOperationCode into FindReplaceDocumentAdapter, removed FindReplaceOperationCode
- - deleted deprecated classes whose Javadoc stated that these classes were internal
- - ChildDocument
- - ChildDocumentManager
- - ParentChildMapping
- - CoordinatesTranslator
- - Fragment
- - FragmentUpdater
- - ProjectionDocument
- - ProjectionDocumentManager
- - ProjectionPosition
- - ProjectionPositionUpdater
- - ProjectionTextStore
-
-- pkg: org.eclipse.jface.text.link
- - removed ExclusivePositionUpdater
- - marked InclusivePositionUpdater as internal class using Javadoc
- - renamed LinkedEnvironment to LinkedModeModel
- - renamed methods accordingly
- - renamed LinkedManager to LinkedModeManager
- - renamed ILinkedListener to ILinkedModeListener
- - renamed LinkedUIControl to LinkedModeUI
- - removed LinkedPositionGroup.createPosition methods
- - use LinkedPositionGroup.addPosition instead
-
-- pkg: org.eclipse.jface.text.templates
- - renamed ContextType to TemplateContextType
- - renamed GlobalVariables to GlobalTemplateVariables
- - renamed SimpleVariableResolver to SimpleTemplateVariableResolver
-
-
-----------------------------------------
-
-plug-in org.eclipse.jface.text
-
-- pkg: org.eclipse.jface.text
- - renamed IAnnotationHoverExtension.getInformationControlCreator to IAnnotationHoverExtension.getHoverControlCreator
- - renamed ITextHoverExtension.getInformationControlCreator to ITextHoverExtension.getHoverControlCreator
-
-- pkg: org.eclipse.jface.text.formatter
- - merged IContentFormatterExtension2 into IContentFormatterExtension
- - removed IContentFormatterExtension.getPartitioning
- - changed configuration methods of MultipassContentFormatter: substituted IFormattingStrategy for IFormattingStrategyExtension, added assert statements
- - deprecated ContentFormatter
-
-- pkg: org.eclipse.jface.text.source
- - deleted deprecated classes whose Javadoc stated that these classes were internal
- - OutlinerRulerColumn
- - ProjectionAnnotation
- - ProjectionSourceViewer
-
-- pkg: org.eclipse.jface.text.reconciler
- - deleted DocumentAdapter
- - renamed AnnotationEvent to VerticalRulerEvent
- - renamed VerticalRulerEvent.getAnnotation to VerticalRulerEvent.getSelectedAnnotation
- - renamed VerticalRulerEvent.setAnnotation to VerticalRulerEvent.setSelectedAnnotation
- - CompositeRuler no longer implements IVerticalRulerListener
- - renamed CompositeRuler.annotationSelected to CompositeRuler.fireAnnotationSelected
- - renamed CompositeRuler.annotationDefaultSelected to CompositeRuler.fireAnnotationDefaultSelected
- - renamed CompositeRuler.annotationContextMenuAboutToShow to CompositeRuler.fireAnnotationContextMenuAboutToShow
- - changed constructor of AnnotationExpandHover to accept CompositeRuler rather than IVerticalRulerInfo and IVerticalRulerListener
-
-- pkg: org.eclipse.jface.text.contentassist
- - moved AbstractControlContentAssistSubjectAdapter to package org.eclipse.jface.contentassist
- - moved ComboContentAssistSubjectAdapter to package org.eclipse.jface.contentassist
- - moved ContentAssistant to package org.eclipse.jface.contentassist
- - moved IContentAssistProcessorExtension to package org.eclipse.jface.contentassist
- - renamed IContentAssistProcessorExtension to ISubjectControlContentAssistProcessor.java
- - moved IContentAssistSubject to package org.eclipse.jface.contentassist
- - renamed to IContentAssistSubject IContentAssistSubjectControl
- - moved IContextInformationPresenterExtension to package org.eclipse.jface.contentassist
- - renamed IContextInformationPresenterExtension to ISubjectControlContextInformationPresenter
- - moved IContextInformationValidatorExtension to package org.eclipse.jface.contentassist
- - renamed IContextInformationValidatorExtension to ISubjectControlContextInformationValidator
- - moved TextContentAssistSubjectAdapter to package org.eclipse.jface.contentassist
- - added ISubjectControlContentAssistant to package org.eclipse.jface.contentassist
- - moved IContentAssistantExtension.install(IContentAssistSubjectControl) to ISubjectControlContentAssistant
- - added SubjectControlContentAssistant to package org.eclipse.jface.contentassist
- - added SubjectControlContextInformationValidator to package org.eclipse.jface.contentassist
-
------------------------------------------------
-
-plug-in org.eclipse.ui.workbench.texteditor
-
-- pkg: org.eclipse.ui.texteditor.templates
- - changed EditTemplateDialog to package visible
- - changed TemplateContentProvider to package visible
-
-- org.eclipse.ui.texteditor
- - removed ChainedPreferenceStore (there is a copy in JDT UI)
- - removed PreferencesAdapter (there is copy in JDT UI)
- - deprecated InfoForm
- - renamed SelectMarkerRulerAction2 to SelectAnnotationRulerAction
- - renamed SmartEnterAction to InsertLineAction
-
-- org.eclipse.ui.texteditor.link
- - removed EditorTarget
- - replaced EditorHistoryUpdater with EditorLinkedModeUI
- - clients no longer configure a LinkedModeUI with the EditorHistoryUpdater but instantiate EditorLinedModeUI
-
--------------------------------------------------
-
-plug-in org.eclipse.ui.editors
-
-- pkg: org.eclipse.ui.texteditor
- - moved AnnotationType to package org.eclipse.ui.internal.texteditor
- - moved AnnotationTypeHierarchy to package org.eclipse.ui.internal.texteditor
- - moved DelegatingAnnotationPreference to package org.eclipse.ui.internal.texteditor
- - marked AnnotationPreferenceLookup.getAnnotationPreferenceFragment as internal method using Javadoc
- - renamed ExtendedTextEditor to AbstractDecoratedTextEditor
- - renamed ExtendedTextEditorPreferenceConstants to AbstractDecoratedTextEditorPreferenceConstants
-
-- pkg: org.eclipse.ui.editors.text
- - removed EditorUI.getAnnotationTypeHierarchy
- - moved WorkspaceOperationRunner to package org.eclipse.ui.internal.editors.text
- - moved UISynchronizationContext to package org.eclipse.ui.internal.editors.text
-
-
---------------------------------------------------
-
-plug-in org.eclipse.core.filebuffers
-- extension point org.eclipse.core.filebuffers.documentSetup now supports the attribute 'fileNames'. The union of
- 'fileNames' and 'extensions' is used for setting up a document.
-- extension point org.eclipse.core.filebuffers.documentCreation now supports the attribute 'fileNames'.
- 'fileName' has precedence over any matching criterion of 'extensions' when creating a document.
-
-
-</pre>
-========== Eclipse Build Input March 23rd 2004 ==========<br>
-<pre>
-- Added the <tt>org.eclipse.ui.editors.templates</tt> extension point to the templates infrastructure.
-- Added an example of using the extension point to the <tt>org.eclipse.ui.examples.javaeditor</tt>
- project, see the <tt>Template Editor Example</tt> source folder and the html description for reference.
-</pre>
-========== Eclipse Build Input March 9th 2004 ==========<br>
-<pre>
-- Moved the templates infrastructure to the text, jface.text and ui.workbench.texteditor
- projects, making it API. The template API is still in the flow and might change considerably.
-
- For people that have been using the internal template code, please note:
- - TemplateVariable has been renamed to TemplateVariableResolver
- - TemplatePosition has benn renamed to TemplateVariable
- - there is first support for adding multiple proposals for a variable
-</pre>
-========== Eclipse Build Input March 2nd 2004 ==========<br>
-<pre>
-- Moved the linked position infrastructure to the text, jface.text and ui.workbench.texteditor
- projects, making in API. See package.html in the relevant sections. This is an intermediate step
- in making templates part of the text infrastructure.
-- The content assistant can now be configured to restore the completion proposal
- popup's size. For details see:
- - ContentAssistant.setRestoreCompletionProposalSize(IDialogSettings)
-- Completion proposal popup of the content assistants in Find/Replace dialog
- now remember their size.
-- Several bugs fixed.
-</pre>
-<br>
-========== Eclipse Build Input February 24th 2004 ==========<br>
-<pre>
-- A source viewer can now be unconfigured and afterwards configured again.
-- Information control managers can now be configured to restore the information
- control's location and size. The information control must implement
- IInformationControlExtension3. For details see:
- - AbstractInformationControlManager.setRestoreInformationControlBounds(...)
- - IInformationControlExtension3.getBounds()
-- Several bugs fixed.
-</pre>
-<br>
-========== Eclipse Build Input February 17th 2004 ==========<br>
-<pre>
-- Several bugs fixed.
-</pre>
-<br>
-========== Eclipse Build Input February 10th 2004 ==========<br>
-<pre>
-- ComboContentAssistSubjectAdapter and TextContentAssistSubjectAdapter allow to
- show cue with tooltip.
-- Annotations drawing in text may now be configured. Current drawing styles are boxes, underline,
- squiggly lines, and an i-beam.
- We might introduce an extension point for specifying custom drawing strategies.
-- A roll-over annotation hover has been introduced to cope with many annotations drawn over each
- other in the vertical ruler. Enable for the Java editor using the roll over preference under
- Java->Work in Progress.
-</pre>
-<br>
-========== Eclipse Build Input January 27th 2004 ==========<br>
-<pre>
-- Improved performance when installing contributed actions.
-- The displayed tab width in the text editor can now be configured,
- see Workbench > Editors > Text Editor preferences.
-- Enhanced content assistant to be usable in Text and Combo,
- see ComboContentAssistSubjectAdapter and TextContentAssistSubjectAdapter.
-- The DefaultAnnotation and its usages which was introduced in 3.0 to be
- create non-marker based annotations has been replaced by new API in Annotation.
-</pre>
-<br>
-========== Eclipse Build Input January 20th 2004 ==========<br>
-<pre>
-- Improved annotation painting: adapted painter to fine grained annotation model delta.
-</pre>
-<br>
-========== Eclipse Build Input December 18th 2003 ==========<br>
-<pre>
-This build contains several changes and additions to the annotation mechanism.
-
-1) Annotation Types
-
-There is now the explicit notion of an annotation type. See Annotation.getType() and Annotation.setType().
-The type of an annotation can change over it's lifetime. A new extension point has been added for the declaration
-of annotation types: "org.eclipse.ui.editors.annotationTypes". An annotation type has a name and can be declared
-as being a subtype of another declared annotation type. An annotation type declaration may also use the attributes
-"markerType" and "markerSeverity" in order to specify that markers of a given type and a given severity should be
-represented in text editors as annotations of a particular annotation type. The attributes "markerType" and
-"markerSeverity" in the "org.eclipse.ui.editors.markerAnnotationSpecification" should no longer be used. Marker
-annotation specifications are thus becoming independent from markers and the name thus misleading. However, the
-name is kept in order to ensure backward compatibility.
-
-Instances of subclasses of AbstractMarkerAnnotationModel automatically detect and set the correct annotation
-types for annotations they create from markers. In order to programmatically retrieve the annotation type for
-a given marker or a given pair of markerType and markerSeverity use org.eclipse.ui.texteditor.AnnotationTypeLookup.
-
-Access to the hierarchy of annotation types is provided by AnnotationTypeHierarchy. For a given annotation type
-name you can get an AnnotationType that provides information about the chain of super types and a method to check
-whether an annotation type given as name is a subtype. You can also retrieve the information from
-IAnnotationAccessExtension. DefaultMarkerAnnotationAccess implements this interface.
-
-2) MarkerAnnotationSpecification
-
-The annotation type is the key with which to find the associated marker annotation specification. As annotation
-types can extend other annotation types, there is an implicit relation between marker annotation specifications
-as well. Therefore a marker annotation specification for a given annotation type is completed by the marker
-annotation specifications given for the super types of the given annotation type. Therefore, marker annotation
-specification do not have to be complete as this was required before. Marker annotation specifications are
-reified by AnnotationPreferences. By using org.eclipse.ui.texteditor.AnnotationPreferenceLookup, you can retrieve
-an annotation preference for a given annotation type that transparently performs the completion of the preference
-along the annotation super type chain.
-
-3) Painting annotation
-
-Marker annotation specification has been extended with three addition attributed in order to allow the definition
-of custom appearances of a given annotation type in the vertical ruler. These attributes are: "icon", "symbolicIcon",
-and "annotationImageProvider". The value for "icon" is the path to a file containing the icon image. The value of
-"symbolicIcon" can be one of "error", "warning", "info", "task", "bookmark". The attribute "symbolicIcon" is used
-to tell the platform that annotation should be depicted with the same images that are used by the platform to
-present errors, warnings, infos, tasks, and bookmarks respectively. The value of "annotationImageProvider" is a
-class implementing org.eclipse.ui.texteditor.IAnnotationImageProvider that allows for a full custom annotation
-presentation.
-
-The vertical ruler uses it's associated IAnnotationAccess/IAnnotationAccessExtension to draw annotations.
-The vertical ruler does not call Annotation.paint any longer. In general, Annotations are no longer supposed
-to draw themselves. The "paint" and "getLayer" methods have been deprecated in order to make annotation eventually
-UI independent. DefaultMarkerAnnotationAccess serves as default implementation of IAnnotationAccess/IAnnotationAccessExtension.
-DefaultMarkerAnnotationAccess implements the following strategy for painting annotations: If an annotation implements
-IAnnotationPresentation, IAnnotationPresentation.paint is called. If not, the annotation image provider is looked up
-in the annotation preference. The annotation image provider is only available if specified and if the plug-in defining
-the enclosing marker annotation specification has already been loaded. If there is an annotation image provider, the
-call is forwarded to it. If not, the specified "icon" is looked up. "symbolicIcon" is used as the final fallback. For
-drawing annotations, the annotation presentation layer is relevant. DefaultMarkerAnnotationAccess looks up the presentation
-layer using the following strategy: If the annotation preference specifies a presentation layer, the specified layer is
-used. If there is no layer and the annotation implements IAnnotationPresentation, IAnnotationPresentation.getLayer is used
-otherwise the default presentation layer (which is 0) is returned.
-
-4) Additions to Annotation
-
-Annotations additionally support: a message, a flag to indicate whether the annotation is marked as deleted, a
-flag to indicate whether the annotation is persistent or temporary.
-
-5) Migration
-
-The following annotation types are declared by the org.eclipse.ui.editors plug-in:
-
- &ltextension point="org.eclipse.ui.editors.annotationTypes"&gt
- &lttype
- name="org.eclipse.ui.workbench.texteditor.error"
- markerType="org.eclipse.core.resources.problemmarker"
- markerSeverity="2"&gt
- &lt/type&gt
- &lttype
- name="org.eclipse.ui.workbench.texteditor.warning"
- markerType="org.eclipse.core.resources.problemmarker"
- markerSeverity="1"&gt
- &lt/type&gt
- &lttype
- name="org.eclipse.ui.workbench.texteditor.info"
- markerType="org.eclipse.core.resources.problemmarker"
- markerSeverity="0"&gt
- &lt/type&gt
- &lttype
- name="org.eclipse.ui.workbench.texteditor.task"
- markerType="org.eclipse.core.resources.taskmarker"&gt
- &lt/type&gt
- &lttype
- name="org.eclipse.ui.workbench.texteditor.bookmark"
- markerType="org.eclipse.core.resources.bookmark"&gt
- &lt/type&gt
- &lt/extension&gt
-
-The defined markerAnnotationSpecification extension no longer provide "markerType" and "markerSeverity"
-attributes. They define the "symbolicIcon" attribute with the according value. Thus, MarkerAnnotation.paint
-and MarkerAnnotation.getLayer are not called any longer, i.e. overriding these methods does not have
-any effect.
-</pre>
-<br>
-========== Eclipse Build Input November 11th 2003 ==========<br>
-<pre>
-- Finished annotation background painter
-- Added new concept of ITextPresentationListener which should be used by clients
- to apply a presentation style (e.g. color, bold) to the text. Clients using
- the StyledText.*styleRange* API methods should convert to this new API. A
- ITextPresentationListener can be added and removed from a text viewer (see
- ITextViewerExtension4)
-</pre>
-<br>
-<br>
-
-========== Eclipse Build Input October 28th 2003 ==========<br>
-<pre>
-- Vertical ruler annotations can be disabled via editor's Annotation preference
- page.
-- Added support to set background for annotations
- - annotation background painter <work in progress>
- - key/value attributes to "org.eclipse.ui.workbench.texteditor.markerAnnotationSpecification" extension-point
- - updated annotation preference page to show this attribute
- - enabled this feature for Search annotations
-</pre>
-<br>
-<br>
-========== Eclipse Build Input October 21th 2003 ==========<br>
-<pre>
-- Incremental find has its own editor status line field (findField)
-- IStatusField has been extended (IStatusFieldExtension) with the following concepts:
- - set error text and image
- - set tool tip
- - control visibility
-</pre>
-<br>
-<br>
-========== Eclipse Build Input October 7th 2003 ==========<br>
-<pre>
-- Find/Replace dialog now offers content assist for regular expression search and replace
-- Changes found by Quickdiff are now ordinary annotations. I.e. they can serve as
- navigation target, can be shown in the overview ruler, and in the text. Their presentation
- colors can also be configured.
-- "Open External File" can be found in the Files menu. It opens files which are not workspace files
- with the associated editor or the default text editor if no editor is specified. Text editors support
- external files.
-</pre>
-<br>
-<br>
-========== Eclipse Build Input September 30th 2003 ==========<br>
-<pre>
-- Find/Replace dialog now supports regular expression search and replace
-- Quick Diff annotations can now be displayed on the overview ruler and support Go to Next / Previous
-</pre>
-<br>
-<br>
-========== Eclipse Build Input August 26th 2003 ==========<br>
-<pre>
-- Improved overview ruler:
- - can now handle annotations on same layer
- - added tool tip text to overview ruler header
- - tool tip text for disabled annotation no longer appears
- - click on overview ruler item respects layer
- - clicking on same overview ruler item jumps to next annotation
-- several bugs fixed
-</pre>
-<br>
-<br>
-========== Eclipse Build Input August 19th 2003 ==========<br>
-<pre>
-- added concept of reconcile step: a reconcile step is one of n steps of a
- reconcile strategy that consists of several steps. See the Java Family example
- to see it in action.
-- added concept of translator: a translator translates a given file into another
- language. The translator is also responsible to provide line mapping information
- for the translation and to compute which offset in an original line corresponds
- to a given offset in a target line. See the Java Family example to see it in action.
-- TextEditor extends now ExtendedTextEditor, an additional layer combining features
- used in rich editors, such as the annotation, line number and overview rulers,
- the print margin, current text highlighting, and quick diff.
-- several bugs fixed
-</pre>
-<br>
-<br>
-========== Eclipse Build Input August 12th 2003 ==========<br>
-<pre>
-- the marker annotation specification can now be used to specify if the annotation
- should allow to be a navigation target. For details read the documentation of
- org.eclipse.workbench.texteditor.markerAnnotationSpecification extension point.
-- several bugs fixed
-</pre>
-<br>
-<br>
-========== Eclipse Build Input July 29th 2003 ==========<br>
-<pre>
-- several bugs fixed
-</pre>
-<br>
-<br>
-========== Eclipse Build Input July 22th 2003 ==========<br>
-<pre>
-- several bugs fixed
-</pre>
-<br>
-<br>
-========== Eclipse Build Input July 16th 2003 ==========<br>
-<!-- Add what's new below and end each line with br tag -->
-<pre>
-- several bugs fixed
-- Improvements and framework changes for the light weight change indication. Change indication
- can now happen in the line number ruler or a dedicated change ruler column.
-</pre>
-<br>
-<br>
-========== Eclipse Build Input July 8th 2003 ==========<br>
-<!-- Add what's new below and end each line with br tag -->
-<pre>
-- several bugs fixed
-- The TextViewer sends out time-out based selection changed events for
- caret position changes for clients registered as post selection changed listeners.
-- The default text editor supports a light weight change indicator integrated with the line number ruler.
- Can be globally enabled on the Text Editor preference page. Can be enabled/disabled for the current editor
- in the editor's context menu or using the short cut "Ctrl+Shift+Q".
-- Text frameworks have been extended to support light weight diffing.
-</pre>
-<br>
-<br>
-========== Eclipse Build Input June 17th 2003 ==========<br>
-<!-- Add what's new below and end each line with br tag -->
-<pre>
-- several bugs fixed
-- The TextViewer sends out time-out based selection changed events for caret position changes.
-- added extension interfaces which allow completion proposals to specify their custom
- information control creator
-</pre>
-<br>
-<br>
-========== Eclipse Build Input June 4th 2003 ==========<br>
-<!-- Add what's new below and end each line with br tag -->
-<pre>
-- several bugs fixed
-- The TextViewer sends out time-out based selection changed events for caret position changes.
-- added extension interfaces which allow text hovers and information providers to specify their custom
- information control creator
-- text editors support three typing modes: Overwrite, Insert, Smart Insert
- - typing modes are toggled by INS in the default key binding
- - each mode is represented with its own caret
- - modes can be disabled per editor, i.e. when toggling insert modes, disabled modes will not be selected
-- status line contribution items can now be associated with an action that is called when double clicking the status item
-</pre>
-<br>
-<br>
-========== Eclipse Build Input May 13th 2003 ==========<br>
-<!-- Add what's new below and end each line with br tag -->
-<pre>
-- several bugs fixed
-- released new features:
- - Insert new line above the caret line (ui name: "Smart Enter (Inverse)", default key binding: Ctrl+Shift+Enter)
- - Insert new line after the caret line (ui name: "Smart Enter", default key binding: Shift+Enter)
- - Move selected lines upwards (ui name: "Move Lines Up", default key binding: Alt+Arrow_UP)
- - Move selected lines down (ui name: "Move Lines Down", default key binding: Alt+Arrow_Down)
- - Change case of selection to upper case (ui name: "To Upper Case", default key binding: Ctrl+Shift+X)
- - Change case of selection to lower case (ui name: "To Lower Case", default key binding: Ctrl+Shift+Y)
-</pre>
-<br>
-<br>
-========== Eclipse Build Input April 29th 2003 ==========<br>
-<!-- Add what's new below and end each line with br tag -->
-<pre>
-- several bugs fixed
-</pre>
-<br>
-<br>
-========== Eclipse Build Input April 22nd 2003 ==========<br>
-<!-- Add what's new below and end each line with br tag -->
-<pre>
-- several bugs fixed
-</pre>
-<br>
-<br>
-</body></html> \ No newline at end of file
diff --git a/org.eclipse.ui.editors/icons/full/ctool16/last_edit_pos.gif b/org.eclipse.ui.editors/icons/full/ctool16/last_edit_pos.gif
deleted file mode 100644
index d43f19194..000000000
--- a/org.eclipse.ui.editors/icons/full/ctool16/last_edit_pos.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.editors/icons/full/ctool16/next_nav.gif b/org.eclipse.ui.editors/icons/full/ctool16/next_nav.gif
deleted file mode 100644
index ce1e02f57..000000000
--- a/org.eclipse.ui.editors/icons/full/ctool16/next_nav.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.editors/icons/full/ctool16/prev_nav.gif b/org.eclipse.ui.editors/icons/full/ctool16/prev_nav.gif
deleted file mode 100644
index 88d173f0e..000000000
--- a/org.eclipse.ui.editors/icons/full/ctool16/prev_nav.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.editors/icons/full/dtool16/last_edit_pos.gif b/org.eclipse.ui.editors/icons/full/dtool16/last_edit_pos.gif
deleted file mode 100644
index 444fcc9b0..000000000
--- a/org.eclipse.ui.editors/icons/full/dtool16/last_edit_pos.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.editors/icons/full/dtool16/next_nav.gif b/org.eclipse.ui.editors/icons/full/dtool16/next_nav.gif
deleted file mode 100644
index 954a83ca0..000000000
--- a/org.eclipse.ui.editors/icons/full/dtool16/next_nav.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.editors/icons/full/dtool16/prev_nav.gif b/org.eclipse.ui.editors/icons/full/dtool16/prev_nav.gif
deleted file mode 100644
index a572efb30..000000000
--- a/org.eclipse.ui.editors/icons/full/dtool16/prev_nav.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.editors/icons/full/etool16/last_edit_pos.gif b/org.eclipse.ui.editors/icons/full/etool16/last_edit_pos.gif
deleted file mode 100644
index c4c7b7400..000000000
--- a/org.eclipse.ui.editors/icons/full/etool16/last_edit_pos.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.editors/icons/full/etool16/next_nav.gif b/org.eclipse.ui.editors/icons/full/etool16/next_nav.gif
deleted file mode 100644
index ce1e02f57..000000000
--- a/org.eclipse.ui.editors/icons/full/etool16/next_nav.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.editors/icons/full/etool16/prev_nav.gif b/org.eclipse.ui.editors/icons/full/etool16/prev_nav.gif
deleted file mode 100644
index 88d173f0e..000000000
--- a/org.eclipse.ui.editors/icons/full/etool16/prev_nav.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.editors/icons/full/obj16/file_obj.gif b/org.eclipse.ui.editors/icons/full/obj16/file_obj.gif
deleted file mode 100644
index b226e41c5..000000000
--- a/org.eclipse.ui.editors/icons/full/obj16/file_obj.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.ui.editors/migration_guidelines.html b/org.eclipse.ui.editors/migration_guidelines.html
deleted file mode 100644
index 42156f26d..000000000
--- a/org.eclipse.ui.editors/migration_guidelines.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en"><html><head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="IBM"><title>Platform Text Breaking API changes</title></head><body text="#000000" bgcolor="#ffffff">
-&nbsp;
-<table border="0" cellspacing="5" cellpadding="2" width="100%">
- <tbody>
- <tr>
- <td align="left" width="72%"> <font size="+3"><b>Platform Text -
-Breaking API changes from R2.1 to R3.0</b></font> <font size="-2" color="#8080ff"><br>
-</font></td>
- </tr>
- <tr>
- <td>
- <ul>
- <li><span style="font-weight: bold; font-style: italic;">org.eclipse.jface.text.source.AnnotationModel.addAnnotation(Annotation, Position, boolean)</span>:
-changed signature to throw <code>org.eclipse.jface.text.BadLocationException</code>
-in order to add support for better handling of invalid document
-positions. Only clients which extend (i.e. call super) this method will be
-broken. To fix the problem either catch the exception from the super
-call or change the signature in the extended method. The latter is
-suggested since clients should decide how to handle invalid document
-positions.<br>
-</li>
- <li><span style="font-weight: bold; font-style: italic;">org.eclipse.ui.texteditor.TextEditorAction.canModifyEditor()</span>:
-added predicate method that checks whether the action's editor can be modified. The method calls different methods on the underlying editor depending on
-which interfaces the editor implements. The method will call <code>ITextEditorExtension2.isEditorInputModifiable()</code> if it is available. Modifing actions
-can call the method when updating their enablement state.<br>
-</li>
- <li><span style="font-weight: bold; font-style: italic;">org.eclipse.ui.texteditor.TextEditorAction.validateEdit()</span>:
- added predicate method that checks and updates the modifiable state of the action's editor. The method calls different methods on the underlying editor depending on
- which interfaces the editor implements. The method will call <code>ITextEditorExtension2.validateEditorInputState()</code> if it is available. Modifing actions
- can call the method before running modifing the editor's content.<br>
-</li>
- <li><span style="font-weight: bold; font-style: italic;">org.eclipse.ui.texteditor.AbstractDecoratedTextEditor</span>:
- A new intermediate class layer has been added between <code>StatusTextEditor</code> and other editors, namely <code>TextEditor</code> and <code>JavaEditor</code>. The additional layer
- includes features found commonly in advanced editors (and especially source editors) such as:
- <ul>
- <li>a vertical ruler to display annotations, line numbers, and quick diff information</li>
- <li>an overview ruler</li>
- <li>current line hightlighting,</li>
- <li>and print margin display</li>
- </ul>
- Implementors of an editor may choose to extend <code>ExtendedTextEditor</code> instead of <code>TextEditor</code>.
- <br>
-</li>
- </ul>
- </td>
- </tr>
- <tr>
- <td> <font size="-1"> This document lists the breaking API
-changes that occurred between R2.1 and R3.0 and how to migrate from the
-R2.1 API to the R3.0 API. </font> </td>
- </tr>
- </tbody>
-</table>
-<p> </p>
-</body></html> \ No newline at end of file
diff --git a/org.eclipse.ui.editors/plugin.properties b/org.eclipse.ui.editors/plugin.properties
deleted file mode 100644
index d0c244f75..000000000
--- a/org.eclipse.ui.editors/plugin.properties
+++ /dev/null
@@ -1,91 +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= Default Text Editor
-providerName= Eclipse.org
-
-ExtPoint.markerUpdaters= Marker Updater
-ExtPoint.documentProviders= Document Provider
-ExtPoint.markerAnnotationSpecification= Marker Annotation Specification
-ExtPoint.annotationTypes= Annotation Types
-ExtPoint.editorTemplate= Editor Template
-
-command.custom.description = Change the encoding to a custom encoding
-command.custom.name = Custom Encoding
-command.iso_8859_1.description = Change the encoding to ISO-8859-1
-command.iso_8859_1.name = ISO-8859-1 Encoding
-command.system.description = Change the encoding to the system encoding
-command.system.name = System Encoding
-command.defaultEncoding.description = Change the encoding to the default encoding
-command.defaultEncoding.name = Default Encoding
-command.us_ascii.description = Change the encoding to US ASCII
-command.us_ascii.name = US ASCII Encoding
-command.utf_16.description = Change the encoding to UTF-16
-command.utf_16.name = UTF-16 Encoding
-command.utf_16be.description = Change the encoding to UTF-16BE
-command.utf_16be.name = UTF-16BE Encoding
-command.utf_16le.description = Change the encoding to UTF-16LE
-command.utf_16le.name = UTF-16LE Encoding
-command.utf_8.description = Change the encoding to UTF-8
-command.utf_8.name = UTF-8 Encoding
-
-openExternalFile.name= Open External File...
-openExternalFile.label= Open External File&...
-openExternalFile.description= Opens an External File
-
-ActionDefinition.quickDiff.name= Quick Diff Toggle
-ActionDefinition.quickDiff.description= Toggles quick diff information display on the line number ruler
-
-Editors.DefaultTextEditor= Text Editor
-PreferencePages.TextEditor= Text Editor
-PreferencePages.Annotations= Annotations
-PreferencePages.QuickDiff= Quick Diff
-
-lastSaveReferenceProvider.label= Version on &Disk
-
-AddTask.label=Add &Task...
-AddTask.tooltip=Add Task...
-AddBookmark.label=Add Boo&kmark...
-AddBookmark.tooltip=Add Bookmark...
-quickdiff.toggle.enable= Enable &QuickDiff
-
-Dummy.label=
-
-openExternalFileActionSet.label= Open External Files
-textEditorAnnotationNavigationActionSet.label= Annotation Navigation
-
-goToPreviousAnnotation.label= Previous Annotation
-goToPreviousAnnotation.tooltip= Previous Annotation
-goToNextAnnotation.label= Next Annotation
-goToNextAnnotation.tooltip= Next Annotation
-
-errors.label= Errors
-warnings.label= Warnings
-infos.label= Info
-tasks.label= Tasks
-bookmarks.label= Bookmarks
-changes.label= Diff Changes
-additions.label= Diff Additions
-deletions.label= Diff Deletions
-spelling.label= Spelling Errors
-
-goToLastEditPosition.label= Last Edit Lo&cation
-goToLastEditPosition.tooltip= Last Edit Location
-
-textEditorNavigationActionSet.label= Editor Navigation
-
-command.folding.expandAll.name = Expand All
-command.folding.expandAll.description = Expands all folded regions
-command.folding.toggle.name = Toggle Folding
-command.folding.toggle.description = Toggles folding in the current editor
-command.folding.expand.name = Expand
-command.folding.expand.description = Expands the folded region at the current selection
-command.folding.collapse.name = Collapse
-command.folding.collapse.description = Collapses the folded region at the current selection
diff --git a/org.eclipse.ui.editors/plugin.xml b/org.eclipse.ui.editors/plugin.xml
deleted file mode 100644
index bbbdfd727..000000000
--- a/org.eclipse.ui.editors/plugin.xml
+++ /dev/null
@@ -1,662 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.ui.editors"
- name="%pluginName"
- version="3.0.0"
- provider-name="%providerName"
- class="org.eclipse.ui.internal.editors.text.EditorsPlugin">
-
- <runtime>
- <library name="editors.jar">
- <export name="*"/>
- </library>
- </runtime>
- <requires>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.ui.ide"/>
- <import plugin="org.eclipse.ui.workbench.texteditor"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.jface.text"/>
- <import plugin="org.eclipse.core.filebuffers" export="true"/>
- <import plugin="org.eclipse.core.resources"/>
- </requires>
-
-
- <extension-point id="documentProviders" name="%ExtPoint.documentProviders" schema="schema/documentProviders.exsd"/>
- <extension-point id="markerUpdaters" name="%ExtPoint.markerUpdaters" schema="schema/markerUpdaters.exsd"/>
- <extension-point id="markerAnnotationSpecification" name="%ExtPoint.markerAnnotationSpecification" schema="schema/markerAnnotationSpecification.exsd"/>
- <extension-point id="annotationTypes" name="%ExtPoint.annotationTypes" schema="schema/annotationTypes.exsd"/>
- <extension-point id="templates" name="%ExtPoint.editorTemplate" schema="schema/templates.exsd"/>
-
- <extension
- point="org.eclipse.ui.commands">
- <command
- name="%command.defaultEncoding.name"
- description="%command.defaultEncoding.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.ui.edit.text.encoding.default">
- </command>
- <command
- name="%command.us_ascii.name"
- description="%command.us_ascii.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.ui.edit.text.encoding.us-ascii">
- </command>
- <command
- name="%command.iso_8859_1.name"
- description="%command.iso_8859_1.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.ui.edit.text.encoding.iso-8859-1">
- </command>
- <command
- name="%command.utf_8.name"
- description="%command.utf_8.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.ui.edit.text.encoding.utf-8">
- </command>
- <command
- name="%command.utf_16be.name"
- description="%command.utf_16be.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.ui.edit.text.encoding.utf-16be">
- </command>
- <command
- name="%command.utf_16le.name"
- description="%command.utf_16le.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.ui.edit.text.encoding.utf-16le">
- </command>
- <command
- name="%command.utf_16.name"
- description="%command.utf_16.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.ui.edit.text.encoding.utf-16">
- </command>
- <command
- name="%command.system.name"
- description="%command.system.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.ui.edit.text.encoding.system">
- </command>
- <command
- name="%command.custom.name"
- description="%command.custom.description"
- categoryId="org.eclipse.ui.category.edit"
- id="org.eclipse.ui.edit.text.encoding.custom">
- </command>
- <command
- name="%openExternalFile.name"
- category="org.eclipse.ui.category.file"
- description="%openExternalFile.description"
- id="org.eclipse.ui.edit.text.openExternalFile">
- </command>
- <command
- name="%ActionDefinition.quickDiff.name"
- category="org.eclipse.ui.category.edit"
- description="%ActionDefinition.quickDiff.description"
- id="org.eclipse.quickdiff.toggle">
- </command>
- <keyBinding
- string="Ctrl+Shift+Q"
- scope="org.eclipse.ui.textEditorScope"
- command="org.eclipse.quickdiff.toggle"
- configuration="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
-
- <!-- folding -->
- <command
- name="%command.folding.toggle.name"
- description="%command.folding.toggle.description"
- categoryId="org.eclipse.ui.category.textEditor"
- id="org.eclipse.ui.edit.text.folding.toggle">
- </command>
- <keyBinding
- commandId="org.eclipse.ui.edit.text.folding.toggle"
- contextId="org.eclipse.ui.textEditorScope"
- keySequence="M1+Numpad_Divide"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- <command
- name="%command.folding.expandAll.name"
- description="%command.folding.expandAll.description"
- categoryId="org.eclipse.ui.category.textEditor"
- id="org.eclipse.ui.edit.text.folding.expand_all">
- </command>
- <keyBinding
- commandId="org.eclipse.ui.edit.text.folding.expand_all"
- contextId="org.eclipse.ui.textEditorScope"
- keySequence="M1+Numpad_Multiply"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- <command
- name="%command.folding.expand.name"
- description="%command.folding.expand.description"
- categoryId="org.eclipse.ui.category.textEditor"
- id="org.eclipse.ui.edit.text.folding.expand">
- </command>
- <keyBinding
- commandId="org.eclipse.ui.edit.text.folding.expand"
- contextId="org.eclipse.ui.textEditorScope"
- keySequence="M1+Numpad_Add"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- <command
- name="%command.folding.collapse.name"
- description="%command.folding.collapse.description"
- categoryId="org.eclipse.ui.category.textEditor"
- id="org.eclipse.ui.edit.text.folding.collapse">
- </command>
- <keyBinding
- commandId="org.eclipse.ui.edit.text.folding.collapse"
- contextId="org.eclipse.ui.textEditorScope"
- keySequence="M1+Numpad_Subtract"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- <keyBinding
- commandId="org.eclipse.ui.edit.cut"
- contextId="org.eclipse.ui.textEditorScope"
- platform="win32"
- keySequence="M1+X"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- <keyBinding
- commandId="org.eclipse.ui.edit.copy"
- contextId="org.eclipse.ui.textEditorScope"
- platform="win32"
- keySequence="M1+C"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- <keyBinding
- commandId="org.eclipse.ui.edit.paste"
- contextId="org.eclipse.ui.textEditorScope"
- platform="win32"
- keySequence="M1+V"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- <keyBinding
- commandId="org.eclipse.ui.edit.cut"
- contextId="org.eclipse.ui.textEditorScope"
- platform="win32"
- keySequence="Shift+Del"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- <keyBinding
- commandId="org.eclipse.ui.edit.copy"
- contextId="org.eclipse.ui.textEditorScope"
- platform="win32"
- keySequence="Ctrl+Insert"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- <keyBinding
- commandId="org.eclipse.ui.edit.paste"
- contextId="org.eclipse.ui.textEditorScope"
- platform="win32"
- keySequence="Shift+Insert"
- keyConfigurationId="org.eclipse.ui.defaultAcceleratorConfiguration">
- </keyBinding>
- </extension>
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- name="%Editors.DefaultTextEditor"
- extensions="txt"
- icon="icons/full/obj16/file_obj.gif"
- class="org.eclipse.ui.editors.text.TextEditor"
- contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
- id="org.eclipse.ui.DefaultTextEditor">
- </editor>
- </extension>
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- name="%PreferencePages.TextEditor"
- category="org.eclipse.ui.preferencePages.Editors"
- class="org.eclipse.ui.internal.editors.text.TextEditorPreferencePage2"
- id="org.eclipse.ui.preferencePages.TextEditor">
- </page>
- <page
- name="%PreferencePages.Annotations"
- category="org.eclipse.ui.preferencePages.Editors"
- class="org.eclipse.ui.internal.editors.text.AnnotationsPreferencePage"
- id="org.eclipse.ui.editors.preferencePages.Annotations">
- </page>
- <page
- name="%PreferencePages.QuickDiff"
- category="org.eclipse.ui.preferencePages.Editors"
- class="org.eclipse.ui.internal.editors.text.QuickDiffPreferencePage"
- id="org.eclipse.ui.editors.preferencePages.QuickDiff">
- </page>
- </extension>
- <extension
- point="org.eclipse.ui.editors.documentProviders">
- <provider
- class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
- inputTypes="org.eclipse.ui.IStorageEditorInput"
- id="org.eclipse.ui.editors.text.StorageDocumentProvider">
- </provider>
- </extension>
- <extension
- point="org.eclipse.ui.editors.documentProviders">
- <provider
- class="org.eclipse.ui.editors.text.TextFileDocumentProvider"
- inputTypes="org.eclipse.ui.internal.editors.text.JavaFileEditorInput"
- id="org.eclipse.ui.editors.text.ExternalFileDocumentProvider">
- </provider>
- </extension>
- <extension
- point="org.eclipse.ui.editors.markerUpdaters">
- <updater
- class="org.eclipse.ui.texteditor.BasicMarkerUpdater"
- id="org.eclipse.ui.texteditor.BasicMarkerUpdater">
- </updater>
- </extension>
- <extension
- point="org.eclipse.ui.workbench.texteditor.quickDiffReferenceProvider">
- <referenceprovider
- default="true"
- label="%lastSaveReferenceProvider.label"
- class="org.eclipse.ui.internal.editors.quickdiff.LastSaveReferenceProvider"
- id="org.eclipse.ui.internal.editors.quickdiff.LastSaveReferenceProvider">
- </referenceprovider>
- </extension>
- <extension
- point="org.eclipse.ui.popupMenus">
- <viewerContribution
- targetID="#TextRulerContext"
- id="org.eclipse.ui.texteditor.ruler.context.actions">
- <action
- label="%AddTask.label"
- helpContextId="org.eclipse.ui.AddTask_action_context"
- class="org.eclipse.ui.texteditor.TaskRulerAction"
- tooltip="%AddTask.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.TaskRulerAction">
- </action>
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- tooltip="%AddBookmark.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- <action
- label="%quickdiff.toggle.enable"
- style="push"
- helpContextId="quickdiff.toggle"
- class="org.eclipse.ui.texteditor.quickdiff.QuickDiffToggleAction"
- menubarPath="quickdiff"
- definitionId="org.eclipse.quickdiff.toggle"
- id="quickdiff.toggle">
- </action>
- </viewerContribution>
- <viewerContribution
- targetID="#RulerContext"
- id="org.eclipse.ui.texteditor.ruler.context.actions">
- <action
- label="%AddTask.label"
- helpContextId="org.eclipse.ui.AddTask_action_context"
- class="org.eclipse.ui.texteditor.TaskRulerAction"
- tooltip="%AddTask.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.TaskRulerAction">
- </action>
- <action
- label="%AddBookmark.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- tooltip="%AddBookmark.tooltip"
- menubarPath="additions"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- <action
- label="%quickdiff.toggle.enable"
- style="push"
- helpContextId="quickdiff.toggle"
- class="org.eclipse.ui.texteditor.quickdiff.QuickDiffToggleAction"
- definitionId="org.eclipse.quickdiff.toggle"
- menubarPath="quickdiff"
- id="quickdiff.toggle">
- </action>
- </viewerContribution>
- </extension>
- <extension
- point="org.eclipse.ui.editorActions">
- <editorContribution
- targetID="org.eclipse.ui.DefaultTextEditor"
- id="org.eclipse.ui.texteditor.ruler.actions">
- <action
- label="%Dummy.label"
- helpContextId="org.eclipse.ui.bookmark_action_context"
- class="org.eclipse.ui.texteditor.BookmarkRulerAction"
- actionID="RulerDoubleClick"
- id="org.eclipse.ui.texteditor.BookmarkRulerAction">
- </action>
- <action
- label="%Dummy.label"
- class="org.eclipse.ui.texteditor.SelectRulerAction"
- actionID="RulerClick"
- id="org.eclipse.ui.texteditor.SelectRulerAction">
- </action>
- </editorContribution>
- <editorContribution
- targetID="org.eclipse.ui.DefaultTextEditor"
- id="org.eclipse.quickdiff.editoractions.texteditor">
- <action
- definitionId="org.eclipse.quickdiff.toggle"
- label="%quickdiff.toggle.enable"
- class="org.eclipse.ui.texteditor.quickdiff.QuickDiffToggleAction"
- id="org.eclipse.ui.texteditor.quickdiff.QuickDiffToggleAction">
- </action>
- </editorContribution>
- </extension>
- <extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- label="%openExternalFileActionSet.label"
- visible="true"
- id="org.eclipse.ui.edit.text.actionSet.openExternalFile">
- <action
- definitionId="org.eclipse.ui.edit.text.openExternalFile"
- label="%openExternalFile.label"
- helpContextId="open_text_editor_action_context"
- class="org.eclipse.ui.internal.editors.text.OpenExternalFileAction"
- tooltip="%openExternalFile.description"
- menubarPath="file/open.ext"
- id="org.eclipse.ui.edit.text.openExternalFile">
- </action>
- </actionSet>
- <actionSet
- label="%textEditorAnnotationNavigationActionSet.label"
- visible="false"
- id="org.eclipse.ui.edit.text.actionSet.annotationNavigation">
- <action
- allowLabelUpdate="true"
- style="pulldown"
- id="org.eclipse.ui.edit.text.gotoPreviousAnnotation"
- toolbarPath="org.eclipse.ui.workbench.navigate/history.group"
- hoverIcon="icons/full/ctool16/prev_nav.gif"
- class="org.eclipse.ui.internal.editors.text.PreviousPulldownActionDelegate"
- definitionId="org.eclipse.ui.navigate.previous"
- disabledIcon="icons/full/dtool16/prev_nav.gif"
- icon="icons/full/etool16/prev_nav.gif"
- label="%goToPreviousAnnotation.label"
- retarget="true"
- tooltip="%goToPreviousAnnotation.tooltip">
- </action>
- <action
- allowLabelUpdate="true"
- style="pulldown"
- id="org.eclipse.ui.edit.text.gotoNextAnnotation"
- toolbarPath="org.eclipse.ui.workbench.navigate/history.group"
- hoverIcon="icons/full/ctool16/next_nav.gif"
- class="org.eclipse.ui.internal.editors.text.NextPulldownActionDelegate"
- definitionId="org.eclipse.ui.navigate.next"
- disabledIcon="icons/full/dtool16/next_nav.gif"
- icon="icons/full/etool16/next_nav.gif"
- label="%goToNextAnnotation.label"
- retarget="true"
- tooltip="%goToNextAnnotation.tooltip">
- </action>
- </actionSet>
- <actionSet
- label="%textEditorNavigationActionSet.label"
- visible="true"
- id="org.eclipse.ui.edit.text.actionSet.navigation">
- <action
- toolbarPath="org.eclipse.ui.workbench.navigate/history.group"
- id="org.eclipse.ui.edit.text.gotoLastEditPosition"
- hoverIcon="icons/full/ctool16/last_edit_pos.gif"
- class="org.eclipse.ui.internal.texteditor.GotoLastEditPositionAction"
- definitionId="org.eclipse.ui.edit.text.gotoLastEditPosition"
- disabledIcon="icons/full/dtool16/last_edit_pos.gif"
- icon="icons/full/etool16/last_edit_pos.gif"
- helpContextId="goto_last_edit_position_action_context"
- label="%goToLastEditPosition.label"
- menubarPath="navigate/"
- tooltip="%goToLastEditPosition.tooltip">
- </action>
- </actionSet>
- </extension>
- <extension
- point="org.eclipse.ui.editors.markerAnnotationSpecification">
- <specification
- annotationType="org.eclipse.ui.workbench.texteditor.error"
- textPreferenceKey="errorIndication"
- presentationLayer="6"
- highlightPreferenceValue="false"
- showInNextPrevDropdownToolbarAction="true"
- textPreferenceValue="true"
- isGoToPreviousNavigationTargetKey="isErrorGoToPreviousNavigationTarget"
- label="%errors.label"
- colorPreferenceKey="errorIndicationColor"
- showInNextPrevDropdownToolbarActionKey="showErrorInNextPrevDropdownToolbarAction"
- symbolicIcon="error"
- isGoToNextNavigationTargetKey="isErrorGoToNextNavigationTarget"
- isGoToNextNavigationTarget="true"
- overviewRulerPreferenceKey="errorIndicationInOverviewRuler"
- verticalRulerPreferenceValue="true"
- highlightPreferenceKey="errorIndicationHighlighting"
- isGoToPreviousNavigationTarget="true"
- verticalRulerPreferenceKey="errorIndicationInVerticalRuler"
- contributesToHeader="true"
- colorPreferenceValue="255,0,128"
- overviewRulerPreferenceValue="true">
- </specification>
- <specification
- annotationType="org.eclipse.ui.workbench.texteditor.warning"
- textPreferenceKey="warningIndication"
- presentationLayer="5"
- highlightPreferenceValue="false"
- showInNextPrevDropdownToolbarAction="true"
- textPreferenceValue="true"
- isGoToPreviousNavigationTargetKey="isWarningGoToPreviousNavigationTarget"
- label="%warnings.label"
- colorPreferenceKey="warningIndicationColor"
- showInNextPrevDropdownToolbarActionKey="showWarningInNextPrevDropdownToolbarAction"
- symbolicIcon="warning"
- isGoToNextNavigationTargetKey="isWarningGoToNextNavigationTarget"
- isGoToNextNavigationTarget="true"
- overviewRulerPreferenceKey="warningIndicationInOverviewRuler"
- verticalRulerPreferenceValue="true"
- highlightPreferenceKey="warningIndicationHighlighting"
- isGoToPreviousNavigationTarget="true"
- verticalRulerPreferenceKey="warningIndicationInVerticalRuler"
- contributesToHeader="true"
- colorPreferenceValue="244,200,45"
- overviewRulerPreferenceValue="true">
- </specification>
- <specification
- annotationType="org.eclipse.ui.workbench.texteditor.info"
- textPreferenceKey="infoIndication"
- presentationLayer="4"
- highlightPreferenceValue="false"
- showInNextPrevDropdownToolbarAction="true"
- textPreferenceValue="false"
- isGoToPreviousNavigationTargetKey="isInfoGoToPreviousNavigationTarget"
- label="%infos.label"
- colorPreferenceKey="infoIndicationColor"
- showInNextPrevDropdownToolbarActionKey="showInfoInNextPrevDropdownToolbarAction"
- symbolicIcon="info"
- isGoToNextNavigationTargetKey="isInfoGoToNextNavigationTarget"
- isGoToNextNavigationTarget="false"
- overviewRulerPreferenceKey="infoIndicationInOverviewRuler"
- verticalRulerPreferenceValue="true"
- highlightPreferenceKey="infoIndicationHighlighting"
- isGoToPreviousNavigationTarget="false"
- verticalRulerPreferenceKey="infoIndicationInVerticalRuler"
- contributesToHeader="false"
- colorPreferenceValue="244,200,45"
- overviewRulerPreferenceValue="true">
- </specification>
- <specification
- annotationType="org.eclipse.ui.workbench.texteditor.task"
- textPreferenceKey="taskIndication"
- presentationLayer="2"
- highlightPreferenceValue="false"
- showInNextPrevDropdownToolbarAction="true"
- textPreferenceValue="false"
- isGoToPreviousNavigationTargetKey="isTaskGoToPreviousNavigationTarget"
- label="%tasks.label"
- colorPreferenceKey="taskIndicationColor"
- showInNextPrevDropdownToolbarActionKey="showTaskInNextPrevDropdownToolbarAction"
- symbolicIcon="task"
- isGoToNextNavigationTargetKey="isTaskGoToNextNavigationTarget"
- isGoToNextNavigationTarget="false"
- overviewRulerPreferenceKey="taskIndicationInOverviewRuler"
- verticalRulerPreferenceValue="true"
- highlightPreferenceKey="taskIndicationHighlighting"
- isGoToPreviousNavigationTarget="false"
- verticalRulerPreferenceKey="taskIndicationInVerticalRuler"
- contributesToHeader="false"
- colorPreferenceValue="0,128,255"
- overviewRulerPreferenceValue="true">
- </specification>
- <specification
- annotationType="org.eclipse.ui.workbench.texteditor.bookmark"
- textPreferenceKey="bookmarkIndication"
- presentationLayer="1"
- highlightPreferenceValue="false"
- showInNextPrevDropdownToolbarAction="true"
- textPreferenceValue="false"
- isGoToPreviousNavigationTargetKey="isBookmarkGoToPreviousNavigationTarget"
- label="%bookmarks.label"
- colorPreferenceKey="bookmarkIndicationColor"
- showInNextPrevDropdownToolbarActionKey="showBookmarkInNextPrevDropdownToolbarAction"
- symbolicIcon="bookmark"
- isGoToNextNavigationTargetKey="isBookmarkGoToNextNavigationTarget"
- isGoToNextNavigationTarget="false"
- overviewRulerPreferenceKey="bookmarkIndicationInOverviewRuler"
- verticalRulerPreferenceValue="true"
- highlightPreferenceKey="bookmarkIndicationHighlighting"
- isGoToPreviousNavigationTarget="false"
- verticalRulerPreferenceKey="bookmarkIndicationInVerticalRuler"
- contributesToHeader="false"
- colorPreferenceValue="34,164,99"
- overviewRulerPreferenceValue="true">
- </specification>
- <specification
- annotationType="org.eclipse.ui.workbench.texteditor.quickdiffChange"
- colorPreferenceValue="204,163,205"
- isGoToPreviousNavigationTarget="false"
- isGoToPreviousNavigationTargetKey="isChangeGoToPreviousNavigationTarget"
- showInNextPrevDropdownToolbarAction="true"
- isGoToNextNavigationTarget="false"
- isGoToNextNavigationTargetKey="isChangeGoToNextNavigationTarget"
- colorPreferenceKey="changeIndicationColor"
- showInNextPrevDropdownToolbarActionKey="showChangeInNextPrevDropdownToolbarAction"
- contributesToHeader="false"
- overviewRulerPreferenceValue="false"
- presentationLayer="0"
- label="%changes.label"
- textPreferenceValue="false"
- textPreferenceKey="changeIndication"
- overviewRulerPreferenceKey="changeIndicationInOverviewRuler"
- verticalRulerPreferenceKey="changeIndicationInVerticalRuler"
- verticalRulerPreferenceValue="false"
- includeOnPreferencePage="false">
- </specification>
- <specification
- annotationType="org.eclipse.ui.workbench.texteditor.quickdiffAddition"
- colorPreferenceValue="188,188,222"
- isGoToPreviousNavigationTarget="false"
- isGoToPreviousNavigationTargetKey="isAdditionGoToPreviousNavigationTarget"
- showInNextPrevDropdownToolbarAction="true"
- isGoToNextNavigationTarget="false"
- isGoToNextNavigationTargetKey="isAdditionGoToNextNavigationTarget"
- colorPreferenceKey="additionIndicationColor"
- showInNextPrevDropdownToolbarActionKey="showAdditionInNextPrevDropdownToolbarAction"
- contributesToHeader="false"
- overviewRulerPreferenceValue="false"
- presentationLayer="0"
- label="%additions.label"
- textPreferenceValue="false"
- textPreferenceKey="additionIndication"
- overviewRulerPreferenceKey="additionIndicationInOverviewRuler"
- verticalRulerPreferenceKey="additionIndicationInVerticalRuler"
- verticalRulerPreferenceValue="false"
- includeOnPreferencePage="false">
- </specification>
- <specification
- annotationType="org.eclipse.ui.workbench.texteditor.quickdiffDeletion"
- colorPreferenceValue="0,0,0"
- isGoToPreviousNavigationTarget="false"
- isGoToPreviousNavigationTargetKey="isDeletionGoToPreviousNavigationTarget"
- showInNextPrevDropdownToolbarAction="false"
- isGoToNextNavigationTarget="false"
- isGoToNextNavigationTargetKey="isDeletionGoToNextNavigationTarget"
- colorPreferenceKey="deletionIndicationColor"
- showInNextPrevDropdownToolbarActionKey="showDeletionInNextPrevDropdownToolbarAction"
- contributesToHeader="false"
- overviewRulerPreferenceValue="false"
- presentationLayer="0"
- label="%deletions.label"
- textPreferenceValue="false"
- textPreferenceKey="deletionIndication"
- overviewRulerPreferenceKey="deletionIndicationInOverviewRuler"
- verticalRulerPreferenceKey="deletionIndicationInVerticalRuler"
- verticalRulerPreferenceValue="false"
- includeOnPreferencePage="false">
- </specification>
- <specification
- annotationType="org.eclipse.ui.workbench.texteditor.spelling"
- label="%spelling.label"
- symbolicIcon="warning"
- presentationLayer="5"
- contributesToHeader="true"
- colorPreferenceKey="spellingIndicationColor"
- colorPreferenceValue="244,200,45"
- textPreferenceKey="spellingIndication"
- textPreferenceValue="true"
- overviewRulerPreferenceKey="spellingIndicationInOverviewRuler"
- overviewRulerPreferenceValue="true"
- verticalRulerPreferenceKey="spellingIndicationInVerticalRuler"
- verticalRulerPreferenceValue="false"
- isGoToPreviousNavigationTargetKey="isSpellingGoToPreviousNavigationTarget"
- isGoToPreviousNavigationTarget="false"
- isGoToNextNavigationTargetKey="isSpellingGoToNextNavigationTarget"
- isGoToNextNavigationTarget="false"
- showInNextPrevDropdownToolbarActionKey="showSpellingInNextPrevDropdownToolbarAction"
- showInNextPrevDropdownToolbarAction="true"
- highlightPreferenceKey="spellingIndicationHighlighting"
- highlightPreferenceValue="false">
- </specification>
- </extension>
-
- <extension
- point="org.eclipse.ui.editors.annotationTypes">
- <type
- name="org.eclipse.ui.workbench.texteditor.error"
- markerType="org.eclipse.core.resources.problemmarker"
- markerSeverity="2">
- </type>
- <type
- name="org.eclipse.ui.workbench.texteditor.warning"
- markerType="org.eclipse.core.resources.problemmarker"
- markerSeverity="1">
- </type>
- <type
- name="org.eclipse.ui.workbench.texteditor.info"
- markerType="org.eclipse.core.resources.problemmarker"
- markerSeverity="0">
- </type>
- <type
- name="org.eclipse.ui.workbench.texteditor.task"
- markerType="org.eclipse.core.resources.taskmarker">
- </type>
- <type
- name="org.eclipse.ui.workbench.texteditor.bookmark"
- markerType="org.eclipse.core.resources.bookmark">
- </type>
- </extension>
-
- <extension
- point="org.eclipse.core.filebuffers.annotationModelCreation">
- <factory
- extensions="*"
- class="org.eclipse.ui.texteditor.ResourceMarkerAnnotationModelFactory">
- </factory>
- </extension>
-</plugin>
diff --git a/org.eclipse.ui.editors/schema/annotationTypes.exsd b/org.eclipse.ui.editors/schema/annotationTypes.exsd
deleted file mode 100644
index ab0297537..000000000
--- a/org.eclipse.ui.editors/schema/annotationTypes.exsd
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.ui.editors">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.ui.editors" id="annotationTypes" name="Annotation Types"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="type"/>
- </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="type">
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="markerType" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="super" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="markerSeverity">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="0">
- </enumeration>
- <enumeration value="1">
- </enumeration>
- <enumeration value="2">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.ui.editors/schema/documentProviders.exsd b/org.eclipse.ui.editors/schema/documentProviders.exsd
deleted file mode 100644
index 3dce37c47..000000000
--- a/org.eclipse.ui.editors/schema/documentProviders.exsd
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.ui.editors">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.ui.editors" id="documentProviders" name="Document Providers"/>
- </appInfo>
- <documentation>
- This extension point is used to define mappings between file types and document providers or between types of editor inputs and document providers that can be used by editors. Document providers must implement the interface &lt;samp&gt;org.eclipse.ui.texteditor.IDocumentProvider&lt;/samp&gt;. Editor inputs must be instance of &lt;samp&gt;org.eclipse.ui.IEditorInput&lt;/samp&gt;.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="provider" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="provider">
- <complexType>
- <attribute name="extensions" type="string">
- <annotation>
- <documentation>
- a comma separated list of file extensions
- </documentation>
- </annotation>
- </attribute>
- <attribute name="inputTypes" type="string">
- <annotation>
- <documentation>
- a comma separated list of qualified editor input class names
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- the qualified name of the document provider class
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- the unique id of this provider
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 3.0 (originally named org.eclipse.ui.documentProviders)
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- &lt;pre&gt;
-&lt;extension point=&quot;org.eclipse.ui.editors.documentProviders&quot;&gt;
- &lt;provider
- extensions=&quot;.jav&quot;
- class=&quot;org.eclipse.ui.examples.javaeditor.JavaDocumentProvider&quot;
- id=&quot;org.eclipse.ui.examples.javaeditor.JavaDocumentProvider&quot;&gt;
- &lt;/provider&gt;
-&lt;/extension&gt;
-&lt;/pre&gt;
-&lt;p&gt;
-This example registers &lt;samp&gt;org.eclipse.ui.examples.javaeditor.JavaDocumentProvider&lt;/samp&gt; as the default provider for files with the extension &quot;.jav&quot;.
-&lt;p&gt;
-&lt;pre&gt;
-&lt;extension point=&quot;org.eclipse.ui.editors.documentProviders&quot;&gt;
- &lt;provider
- inputTypes=&quot;org.eclipse.ui.IStorageEditorInput&quot;
- class=&quot;org.eclipse.ui.editors.text.FileDocumentProvider&quot;
- id=&quot;org.eclipse.ui.editors.text.FileDocumentProvider&quot;&gt;
- &lt;/provider&gt;
-&lt;/extension&gt;
-&lt;/pre&gt;
-&lt;/p&gt;
-This example registers &lt;samp&gt;org.eclipse.ui.editors.text.FileDocumentProvider&lt;/samp&gt; as the default provider for all editor inputs that are &lt;samp&gt;instance of org.eclipse.ui.IStorageEditorInput&lt;/samp&gt;.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Document providers registered for a file extension have precedence over those registered for input types. Document providers must implement the interface &lt;samp&gt;org.eclipse.ui.texteditor.IDocumentProvider&lt;/samp&gt;. Editor inputs must be instance of &lt;samp&gt;org.eclipse.ui.IEditorInput&lt;/samp&gt;.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- &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=0 height=14 width=324&gt;
-&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.ui.editors/schema/markerAnnotationSpecification.exsd b/org.eclipse.ui.editors/schema/markerAnnotationSpecification.exsd
deleted file mode 100644
index d3ab02233..000000000
--- a/org.eclipse.ui.editors/schema/markerAnnotationSpecification.exsd
+++ /dev/null
@@ -1,334 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.ui.editors">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.ui.editors" id="markerAnnotationSpecification" name="Marker Annotation Specification"/>
- </appInfo>
- <documentation>
- This extension point is used to define presentation properties of markers. Extensions provided for this extension point can be accessed using &lt;samp&gt;org.eclipse.ui.texteditor.MarkerAnnotationPreferences&lt;/samp&gt;. Use &lt;samp&gt;org.eclipse.ui.texteditor.AnnotationPreferenceLookup&lt;/samp&gt; to get the annotation preference for a given annotation.
-&lt;p&gt;
-Note that an extension will only be returned from &lt;code&gt;MarkerAnnotationPreferences.getAnnotationPreferences&lt;/code&gt; (and thus included in the preference pages) if it contains the following four attributes in addition to the required &lt;code&gt;annotationType&lt;/code&gt;:
-&lt;ul&gt;
- &lt;li&gt;&lt;code&gt;colorPreferenceKey&lt;/code&gt;&lt;/li&gt;
- &lt;li&gt;&lt;code&gt;colorPreferenceValue&lt;/code&gt;&lt;/li&gt;
- &lt;li&gt;&lt;code&gt;overviewRulerPreferenceKey&lt;/code&gt;&lt;/li&gt;
- &lt;li&gt;&lt;code&gt;textPreferenceKey&lt;/code&gt;&lt;/li&gt;
-&lt;/ul&gt;
-&lt;/p&gt;
-&lt;p&gt;
-Annotation preference types that extend another annotation preference are allowed to overwrite attributes already defined in a parent preference specification, but these will not be accessible from the preference page.
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="specification"/>
- </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="specification">
- <complexType>
- <attribute name="annotationType" type="string" use="required">
- <annotation>
- <documentation>
- The annotation type.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="colorPreferenceKey" type="string">
- <annotation>
- <documentation>
- The color preference key must be provided, otherwise this annotation type will not be included in the List returned from MarkerAnnotationPreferences.getAnnotationPreferences() and thus not show in the preferences.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="overviewRulerPreferenceKey" type="string">
- <annotation>
- <documentation>
- The overview ruler preference key must be provided, otherwise this annotation type will not be included in the List returned from MarkerAnnotationPreferences.getAnnotationPreferences() and thus not show in the preferences.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="verticalRulerPreferenceKey" type="string">
- <annotation>
- <documentation>
- The preference key for the show in vertical ruler preference.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="textPreferenceKey" type="string">
- <annotation>
- <documentation>
- The text preference key must be provided, otherwise this annotation type will not be included in the List returned from MarkerAnnotationPreferences.getAnnotationPreferences() and thus not show in the preferences.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="highlightPreferenceKey" type="string">
- <annotation>
- <documentation>
- The preference key for highlighting in text.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="colorPreferenceValue" type="string">
- <annotation>
- <documentation>
- The color preference value must be provided, otherwise this annotation type will not be included in the List returned from MarkerAnnotationPreferences.getAnnotationPreferences() and thus not show in the preferences.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="presentationLayer" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="overviewRulerPreferenceValue" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="verticalRulerPreferenceValue" type="boolean">
- <annotation>
- <documentation>
- The default value for showing in vertical ruler.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="textPreferenceValue" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="highlightPreferenceValue" type="boolean">
- <annotation>
- <documentation>
- The default value for highlighting in text.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="contributesToHeader" type="boolean">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="showInNextPrevDropdownToolbarActionKey" type="string">
- <annotation>
- <documentation>
- The preference key for the visibility in the next/previous drop down toolbar action.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="showInNextPrevDropdownToolbarAction" type="boolean">
- <annotation>
- <documentation>
- The default value for the visibility in the next/previous drop down toolbar action.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="isGoToNextNavigationTargetKey" type="string">
- <annotation>
- <documentation>
- The preference key for go to next navigation enablement.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="isGoToNextNavigationTarget" type="boolean">
- <annotation>
- <documentation>
- The default value for go to next navigation enablement.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="isGoToPreviousNavigationTargetKey" type="string">
- <annotation>
- <documentation>
- The preference key for go to previous navigation enablement.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="isGoToPreviousNavigationTarget" type="boolean">
- <annotation>
- <documentation>
- The default value for go to previous navigation enablement.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- The path to the icon to be drawn for annotations of this annotation type.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="symbolicIcon">
- <annotation>
- <documentation>
- The symbolic name of the image that should be drawn to represent annotation of this annotation type. The image is only used when there is no vertical ruler icon specified for this annotation type. Possible values are: &quot;error&quot;, &quot;warning&quot;, &quot;info&quot;, &quot;task&quot;, &quot;bookmark&quot;.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="error">
- </enumeration>
- <enumeration value="warning">
- </enumeration>
- <enumeration value="info">
- </enumeration>
- <enumeration value="task">
- </enumeration>
- <enumeration value="bookmark">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="annotationImageProvider" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="textStylePreferenceKey" type="string">
- <annotation>
- <documentation>
- The preference key for the text decoration property.
-since: 3.0
- </documentation>
- </annotation>
- </attribute>
- <attribute name="textStylePreferenceValue">
- <annotation>
- <documentation>
- The default value for the &quot;show in text&quot; decoration style.
-since: 3.0
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="SQUIGGLIES">
- </enumeration>
- <enumeration value="BOX">
- </enumeration>
- <enumeration value="UNDERLINE">
- </enumeration>
- <enumeration value="IBEAM">
- </enumeration>
- <enumeration value="NONE">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- <attribute name="includeOnPreferencePage" type="boolean" use="default" value="true">
- <annotation>
- <documentation>
- Defines whether this annotation type should be configurable via the standard annotation preference page. Default is true.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 3.0 (originally named org.eclipse.ui.workbench.texteditor.markerAnnotationSpecification)
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- &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=0 height=14 width=324&gt;&lt;/a&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.ui.editors/schema/markerUpdaters.exsd b/org.eclipse.ui.editors/schema/markerUpdaters.exsd
deleted file mode 100644
index a6e9953f6..000000000
--- a/org.eclipse.ui.editors/schema/markerUpdaters.exsd
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.ui.editors">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.ui.editors" id="markerUpdaters" name="Marker Updaters"/>
- </appInfo>
- <documentation>
- This extension point is used for registering marker update strategies with marker annotation models. A resource that is opened in a text editor is associated with a marker annotation model. For each marker attached to the resource this model manages a position that is updated with each change applied to the text in the editor. If the resource is saved, the text in the editor and the position managed for a marker are passed over to the registered marker update strategies. These strategies can then update the marker&apos;s attributes based on the text and the position. Marker update strategies are requested to implement the interface &lt;samp&gt;org.eclipse.ui.texteditor.IMarkerUpdater&lt;/samp&gt;. The update strategies can be registered either for a particular marker type or all marker types. The latter by omitting any marker type in the extension.
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="updater" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
- a fully qualified identifier of the target extension point
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- an optional identifier of the extension instance
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- an optional name of the extension instance
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="updater">
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- the unique id of this provider
- </documentation>
- </annotation>
- </attribute>
- <attribute name="markerType" type="string">
- <annotation>
- <documentation>
- the name of the marker type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- the qualified name of the marker updater class
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 3.0 (originally named org.eclipse.ui.markerUpdaters)
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- &lt;pre&gt;
-&lt;extension point= &quot;org.eclipse.ui.editors.markerUpdaters&quot;&gt;
- &lt;updater
- id=&quot;org.eclipse.jdt.ui.markerUpdaters.JavaSearchMarkerUpdater&quot;
- class=&quot;org.eclipse.jdt.internal.ui.search.JavaSearchMarkerUpdater&quot;
- markerType=&quot;org.eclipse.search.searchmarker&quot;&gt;
- &lt;/updater&gt;
-&lt;/extension&gt;
-&lt;/pre&gt;
-&lt;p&gt;
-This example registers &lt;samp&gt;org.eclipse.jdt.internal.ui.search.JavaSearchMarkerUpdater&lt;/samp&gt; as a marker updater for all markers of the
-type &lt;samp&gt;org.eclipse.search.searchmarker&lt;/samp&gt; including all its derived types.
-&lt;/p&gt;
-&lt;pre&gt;
-&lt;extension point= &quot;org.eclipse.ui.editors.markerUpdaters&quot;&gt;
- &lt;updater
- id=&quot;org.eclipse.ui.texteditor.BasicMarkerUpdater&quot;
- class=&quot;org.eclipse.ui.texteditor.BasicMarkerUpdater&quot;&gt;
- &lt;/updater&gt;
-&lt;/extension&gt;
-&lt;/pre&gt;
-&lt;p&gt;
-This example registers &lt;samp&gt;org.eclipse.ui.texteditor.BasicMarkerUpdater&lt;/samp&gt; as a marker updater independent from the type of the marker.
-&lt;/p&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- Registered marker updaters have to implement the interface &lt;samp&gt;org.eclipse.ui.texteditor.IMarkerUpdater&lt;/samp&gt;.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
-
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- &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=0 height=14 width=324&gt;&lt;/a&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.ui.editors/schema/templates.exsd b/org.eclipse.ui.editors/schema/templates.exsd
deleted file mode 100644
index 594ff80fb..000000000
--- a/org.eclipse.ui.editors/schema/templates.exsd
+++ /dev/null
@@ -1,317 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.ui.editors">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.ui.editors" id="null" name="Editor Template"/>
- </appInfo>
- <documentation>
- Templates are snippets of text or code which help the user enter reoccurring patterns into a text editor. Templates may contain variables which are resolved in the context where the template is inserted.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="template" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="resolver" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="contextType" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="include" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="contextType">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name"/>
- </appInfo>
- <documentation>
- A context type defines a context within which templates are evaluated. A context type uses its resolvers to resolve a template.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Unambiguously identifies this context type. Use of a qualified name is recommended.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- A subclass of &lt;code&gt;org.eclipse.jface.text.templates.TemplateContextType&lt;/code&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- The display name of this context.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="resolver">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name" icon="icon"/>
- </appInfo>
- <documentation>
- A template variable resolver can resolve a template variable in a certain context.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="contextTypeId" type="string" use="required">
- <annotation>
- <documentation>
- References the context type that this resolver is contributed to.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="type" type="string" use="required">
- <annotation>
- <documentation>
- The type of this variable resolver. This property will be set on the resolver once it gets created.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- A subclass of &lt;code&gt;org.eclipse.jface.text.templates.TemplateVariableResolver&lt;/code&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- The description of this variable resolver. This property will be set on the resolver once it gets created.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- The display name of this resolver.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- An icon that may be displayed in the user interface.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="template">
- <annotation>
- <appInfo>
- <meta.element labelAttribute="name" icon="icon"/>
- </appInfo>
- <documentation>
- A template is a snippet of code or text that will be evaluated in a given context. Variables which will be resolved in that context can be specified using the &lt;tt&gt;${variable_type}&lt;/tt&gt; notation.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="pattern"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- Unambiguously identifies this template. Use of a qualified name is recommended.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="contextTypeId" type="string" use="required">
- <annotation>
- <documentation>
- References the context type that this template is contributed to.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- The internationalizable name of the template which will show up in the UI, such as in template proposals.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- The description of this template.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- An icon that may be displayed in the UI for this template, for example in content assist proposals.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="pattern" type="string">
- <annotation>
- <documentation>
- The template pattern.
- </documentation>
- </annotation>
- </element>
-
- <element name="include">
- <annotation>
- <documentation>
- A collection of templates encoded as XML can be included as a whole via this element.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="file" type="string" use="required">
- <annotation>
- <documentation>
- The XML file to import templates from.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="translations" type="string">
- <annotation>
- <documentation>
- An optional properties file with resources for the templates specified in &lt;tt&gt;file&lt;/tt&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </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;extension
- point=&quot;org.eclipse.ui.examples.templateeditor.template&quot;&gt;
- &lt;template
- name=&quot;javac&quot;
- context=&quot;ant&quot;
- editorId=&quot;org.eclipse.ui.examples.templateeditor.editors.TemplateEditor&quot;
- description=&quot;%ant.tasks.javac.description&quot;&gt;
- &lt;pattern&gt;&amp;lt;javac srcdir=&amp;quot;${src}&amp;quot;
- destdir=&amp;quot;${dst}&amp;quot;
- classpath=&amp;quot;${classpath}&amp;quot;
- debug=&amp;quot;${debug}&amp;quot;
-/&amp;gt;&lt;/pattern&gt;
- &lt;/template&gt;
-
- &lt;resolver
- context=&quot;ant&quot;
- type=&quot;src&quot;
- editorId=&quot;org.eclipse.ui.examples.templateeditor.editors.TemplateEditor&quot;
- class=&quot;org.eclipse.ui.examples.templateeditor.editors.AntVariableResolver&quot;&gt;
- &lt;/resolver&gt;
-
- &lt;resolver
- context=&quot;ant&quot;
- type=&quot;dst&quot;
- editorId=&quot;org.eclipse.ui.examples.templateeditor.editors.TemplateEditor&quot;
- class=&quot;org.eclipse.ui.examples.templateeditor.editors.AntVariableResolver&quot;&gt;
- &lt;/resolver&gt;
- &lt;/extension&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiInfo"/>
- </appInfo>
- <documentation>
- See the &lt;code&gt;org.eclipse.jface.text.templates&lt;/code&gt; package in the &lt;tt&gt;org.eclipse.text&lt;/tt&gt; plug-in for the relevant API.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- See the &lt;code&gt;org.eclipse.jface.text.templates&lt;/code&gt; package in the &lt;tt&gt;org.eclipse.text&lt;/tt&gt; plug-in for the relevant classes.
- </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=0 height=14 width=324&gt;&lt;/a&gt;
-&lt;/p&gt;
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.ui.editors/scripts/exportplugin.xml b/org.eclipse.ui.editors/scripts/exportplugin.xml
deleted file mode 100644
index 4448589d9..000000000
--- a/org.eclipse.ui.editors/scripts/exportplugin.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<project name="Default Text Editor" default="export" basedir="..">
- <target name="init">
- <tstamp/>
- <property name="destdir" value="../../plugin-export" />
- <property name="plugin" value="org.eclipse.ui.editors" />
- <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}/editors.jar"
- basedir="bin"
- />
- <copy file="plugin.xml" todir="${dest}"/>
- <copy file="plugin.properties" todir="${dest}"/>
- <copy todir= "${dest}/icons">
- <fileset dir="icons"/>
- </copy>
- <zip zipfile="${dest}/editorssrc.zip">
- <fileset dir="src" />
- </zip>
- </target>
-</project>
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/DefaultEncodingSupport.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/DefaultEncodingSupport.java
deleted file mode 100644
index 65fbeb337..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/DefaultEncodingSupport.java
+++ /dev/null
@@ -1,226 +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.ui.editors.text;
-
-import java.io.CharConversionException;
-import java.io.UnsupportedEncodingException;
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Preferences;
-
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.StatusTextEditor;
-
-
-/**
- * The standard implementation of <code>IEncodingSupport</code>.
- * @since 2.0
- */
-public class DefaultEncodingSupport implements IEncodingSupport {
-
- /** Internal property change listener. */
- private Preferences.IPropertyChangeListener fPropertyChangeListener;
- /** The editor this support is associated with. */
- private StatusTextEditor fTextEditor;
- /** The action group of this support. */
- private EncodingActionGroup fEncodingActionGroup;
-
- /**
- * Creates a new encoding support.
- */
- public DefaultEncodingSupport() {
- super();
- }
-
- /**
- * Associates this encoding support to the given text editor and initializes this encoding.
- *
- * @param textEditor the editor
- */
- public void initialize(StatusTextEditor textEditor) {
-
- fTextEditor= textEditor;
-
- fPropertyChangeListener= new Preferences.IPropertyChangeListener() {
- public void propertyChange(Preferences.PropertyChangeEvent e) {
- if (ResourcesPlugin.PREF_ENCODING.equals(e.getProperty()))
- setEncoding(null, false); // null means: use default
- }
- };
-
- Preferences p= ResourcesPlugin.getPlugin().getPluginPreferences();
- p.addPropertyChangeListener(fPropertyChangeListener);
-
- fEncodingActionGroup= new EncodingActionGroup(fTextEditor);
- fEncodingActionGroup.update();
- }
-
- /**
- * Disposes this encoding support.
- */
- public void dispose() {
- Preferences p= ResourcesPlugin.getPlugin().getPluginPreferences();
- p.removePropertyChangeListener(fPropertyChangeListener);
-
- fEncodingActionGroup.dispose();
- fEncodingActionGroup= null;
-
- fTextEditor= null;
- }
-
- /**
- * Resets this encoding support. Should be called if, e.g., the input element of the
- * associated editor changed.
- */
- public void reset() {
- fEncodingActionGroup.update();
- }
-
- /**
- * Sets the encoding of the editor's input to the given value. If <code>overwrite</code> is
- * <code>true</code> the value is set even if the encoding is already set.
- *
- * @param encoding the new encoding
- * @param overwrite <code>true</code> if current encoding should be overwritten
- */
- protected void setEncoding(String encoding, boolean overwrite) {
- IDocumentProvider p= fTextEditor.getDocumentProvider();
- if (p instanceof IStorageDocumentProvider) {
- final IEditorInput input= fTextEditor.getEditorInput();
- IStorageDocumentProvider provider= (IStorageDocumentProvider)p;
- String current= provider.getEncoding(input);
- if (!fTextEditor.isDirty()) {
- String internal= encoding == null ? "" : encoding; //$NON-NLS-1$
- boolean apply= (overwrite || current == null) && !internal.equals(current);
- if (apply) {
- provider.setEncoding(input, encoding);
- Runnable encodingSetter=
- new Runnable() {
- public void run() {
- fTextEditor.doRevertToSaved();
- fTextEditor.updatePartControl(input);
- }
- };
- Display display= fTextEditor.getSite().getShell().getDisplay();
- if (display != null && !display.isDisposed())
- BusyIndicator.showWhile(display, encodingSetter);
- else
- encodingSetter.run();
- }
- }
- fEncodingActionGroup.update();
- }
- }
-
- /*
- * @see IEncodingSupport#setEncoding(String)
- */
- public void setEncoding(String encoding) {
- setEncoding(encoding, true);
- }
-
- /*
- * @see IEncodingSupport#getEncoding()
- */
- public String getEncoding() {
- IDocumentProvider p= fTextEditor.getDocumentProvider();
- if (p instanceof IStorageDocumentProvider) {
- IStorageDocumentProvider provider= (IStorageDocumentProvider) p;
- return provider.getEncoding(fTextEditor.getEditorInput());
- }
- return null;
- }
-
- /*
- * @see IEncodingSupport#getDefaultEncoding()
- */
- public String getDefaultEncoding() {
- IDocumentProvider p= fTextEditor.getDocumentProvider();
- if (p instanceof IStorageDocumentProvider) {
- IStorageDocumentProvider provider= (IStorageDocumentProvider) p;
- return provider.getDefaultEncoding();
- }
- return null;
- }
-
- /**
- * Returns a status header for the given status.
- *
- * @param status the status
- * @return a status header for the given status.
- */
- public String getStatusHeader(IStatus status) {
- Throwable t= status.getException();
-
- if (t instanceof CharConversionException)
- return TextEditorMessages.getString("Editor.error.unreadable_encoding.header"); //$NON-NLS-1$
-
- if (t instanceof UnsupportedEncodingException)
- return TextEditorMessages.getString("Editor.error.unsupported_encoding.header"); //$NON-NLS-1$
-
- return null;
- }
-
- /**
- * Returns a banner for the given status.
- *
- * @param status the status
- * @return a banner for the given status.
- */
- public String getStatusBanner(IStatus status) {
- Throwable t= status.getException();
-
- if (t instanceof CharConversionException)
- return TextEditorMessages.getString("Editor.error.unreadable_encoding.banner"); //$NON-NLS-1$
-
- if (t instanceof UnsupportedEncodingException)
- return TextEditorMessages.getString("Editor.error.unsupported_encoding.banner"); //$NON-NLS-1$
-
- return null;
-
- }
-
- /**
- * Returns a status message if any.
- *
- * @param status the status
- * @return a status message indicating encoding problems or <code>null</code> otherwise
- */
- public String getStatusMessage(IStatus status) {
- Throwable t= status.getException();
- if (t instanceof CharConversionException || t instanceof UnsupportedEncodingException) {
-
- String encoding= getEncoding();
- if (encoding == null)
- encoding= getDefaultEncoding();
-
- if (t instanceof CharConversionException) {
- if (encoding != null)
- return MessageFormat.format(TextEditorMessages.getString("Editor.error.unreadable_encoding.message_arg"), new Object[] { encoding }); //$NON-NLS-1$
- return TextEditorMessages.getString("Editor.error.unreadable_encoding.message"); //$NON-NLS-1$
- }
-
- if (t instanceof UnsupportedEncodingException) {
- if (encoding != null)
- return TextEditorMessages.getFormattedString("Editor.error.unsupported_encoding.message_arg", encoding); //$NON-NLS-1$
- return TextEditorMessages.getString("Editor.error.unsupported_encoding.message"); //$NON-NLS-1$
- }
- }
-
- return null;
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EditorsUI.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EditorsUI.java
deleted file mode 100644
index ceb5384f4..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EditorsUI.java
+++ /dev/null
@@ -1,141 +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.ui.editors.text;
-
-import org.eclipse.core.runtime.Preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.ui.texteditor.AnnotationPreferenceLookup;
-import org.eclipse.ui.texteditor.AnnotationTypeLookup;
-import org.eclipse.ui.texteditor.MarkerAnnotationPreferences;
-
-/**
- * The central class for access to this plug-in.
- * This class cannot be instantiated; all functionality is provided by
- * static methods.
- *
- * @since 3.0
- */
-public final class EditorsUI {
-
- /**
- * TextEditor Plug-in ID (value <code>"org.eclipse.ui.editors"</code>).
- */
- public static final String PLUGIN_ID= "org.eclipse.ui.editors"; //$NON-NLS-1$
-
- /**
- * The ID of the default text editor.
- */
- public static final String DEFAULT_TEXT_EDITOR_ID = "org.eclipse.ui.DefaultTextEditor"; //$NON-NLS-1$
-
-
- /**
- * Returns the annotation type lookup of this plug-in.
- *
- * @return the annotation type lookup
- */
- public static AnnotationTypeLookup getAnnotationTypeLookup() {
- return EditorsPlugin.getDefault().getAnnotationTypeLookup();
- }
-
- /**
- * Returns the annotation preference lookup of this plug-in.
- *
- * @return the annotation preference lookup
- */
- public static AnnotationPreferenceLookup getAnnotationPreferenceLookup() {
- return EditorsPlugin.getDefault().getAnnotationPreferenceLookup();
- }
-
- /**
- * Returns the preference store of this plug-in.
- *
- * @return this plug-in's preference store
- */
- public static IPreferenceStore getPreferenceStore() {
- return EditorsPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * Removes all preference which are handled by this plug-in's
- * general preference pages from the given store and prevents
- * setting the default values in the future.
- * <p>
- * To access the
- * general preference from another plug-in use a
- * {@link org.eclipse.ui.texteditor.ChainedPreferenceStore}:
- * <pre>
- * List stores= new ArrayList(3);
- * stores.add(YourPlugin.getDefault().getPreferenceStore());
- * stores.add(EditorsUI.getPreferenceStore());
- * combinedStore= new ChainedPreferenceStore((IPreferenceStore[]) stores.toArray(new IPreferenceStore[stores.size()]));
- *
- * </pre>
- * </p>
- * <p>
- * Note: In order to work this method must be called before
- * the store's default values are set.
- * </p>
- *
- * @param store the preference store to mark
- */
- public static void useAnnotationsPreferencePage(IPreferenceStore store) {
- MarkerAnnotationPreferences.useAnnotationsPreferencePage(store);
- }
-
- /**
- * Removes all preference which are handled by this plug-in's
- * Quick Diff preference page from the given store and prevents
- * setting the default values in the future.
- * <p>
- * To access the
- * general preference from another plug-in use a
- * {@link org.eclipse.ui.texteditor.ChainedPreferenceStore}:
- * <pre>
- * List stores= new ArrayList(3);
- * stores.add(YourPlugin.getDefault().getPreferenceStore());
- * stores.add(EditorsUI.getPreferenceStore());
- * combinedStore= new ChainedPreferenceStore((IPreferenceStore[]) stores.toArray(new IPreferenceStore[stores.size()]));
- *
- * </pre>
- * </p>
- * <p>
- * Note: In order to work this method must be called before
- * the store's default values are set.
- * </p>
- *
- * @param store the preference store to mark
- */
- public static void useQuickDiffPreferencePage(IPreferenceStore store) {
- MarkerAnnotationPreferences.useQuickDiffPreferencePage(store);
-
- store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON);
- store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_CHARACTER_MODE);
- store.setToDefault(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER);
- }
-
- private EditorsUI() {
- // block instantiation
- }
-
- /**
- * Returns the preferences of this plug-in.
- *
- * @return the plug-in preferences
- * @see org.eclipse.core.runtime.Plugin#getPluginPreferences()
- */
- public static Preferences getPluginPreferences() {
- return EditorsPlugin.getDefault().getPluginPreferences();
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EncodingActionGroup.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EncodingActionGroup.java
deleted file mode 100644
index bb774194d..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/EncodingActionGroup.java
+++ /dev/null
@@ -1,463 +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.ui.editors.text;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentDescription;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.window.Window;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.IUpdate;
-import org.eclipse.ui.texteditor.ResourceAction;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.ui.texteditor.TextEditorAction;
-
-
-/**
- * Action group for encoding actions.
- * @since 2.0
- */
-public class EncodingActionGroup extends ActionGroup {
-
- private static final String FILE_CONTENT_ENCODING_FORMAT= TextEditorMessages.getString("ResourceInfo.fileContentEncodingFormat"); //$NON-NLS-1$
- private static final String FILE_CONTAINER_ENCODING_FORMAT= TextEditorMessages.getString("ResourceInfo.fileContainerEncodingFormat"); //$NON-NLS-1$
-
-
- /**
- * Action for setting the encoding of the editor to the value this action has
- * been initialized with.
- */
- static class PredefinedEncodingAction extends TextEditorAction {
-
- /** The target encoding of this action. */
- private String fEncoding;
- /** The action label. */
- private String fLabel;
- /** Indicates whether the target encoding is the default encoding. */
- private boolean fIsDefault;
-
- /**
- * Creates a new action for the given specification.
- *
- * @param bundle the resource bundle
- * @param prefix the prefix for lookups from the resource bundle
- * @param encoding the target encoding
- * @param editor the target editor
- */
- public PredefinedEncodingAction(ResourceBundle bundle, String prefix, String encoding, ITextEditor editor) {
- super(bundle, prefix, editor);
- fEncoding= encoding;
- if (prefix == null)
- setText(encoding);
- fLabel= getText();
- }
-
- /**
- * Creates a new action for the given specification.
- *
- * @param bundle the resource bundle
- * @param encoding the target encoding
- * @param editor the target editor
- */
- public PredefinedEncodingAction(ResourceBundle bundle, String encoding, ITextEditor editor) {
- super(bundle, null, editor);
- fEncoding= encoding;
- setText(encoding);
- fLabel= getText();
- }
-
- /**
- * Returns the encoding support of the action's editor.
- *
- * @return the encoding support of the action's editor or <code>null</code> if none
- */
- private IEncodingSupport getEncodingSupport() {
- ITextEditor editor= getTextEditor();
- if (editor != null)
- return (IEncodingSupport) editor.getAdapter(IEncodingSupport.class);
- return null;
- }
-
- /*
- * @see IAction#run()
- */
- public void run() {
- IEncodingSupport s= getEncodingSupport();
- if (s != null)
- s.setEncoding(fIsDefault ? null : fEncoding);
- }
-
- /**
- * Returns the encoding currently used in the given editor.
- *
- * @param editor the editor
- * @return the encoding currently used in the given editor or <code>null</code> if no encoding support is installed
- */
- private String getEncoding(ITextEditor editor) {
-
- IEditorInput input= (editor.getEditorInput());
- if (input instanceof IFileEditorInput) {
- IFile file= ((IFileEditorInput)input).getFile();
- try {
- String explicitEncoding;
- explicitEncoding= file.getCharset(false);
- if (explicitEncoding == null)
- return null;
- } catch (CoreException e) {
- // continue - assume file is not using default encoding
- }
- }
-
- IEncodingSupport s= getEncodingSupport();
- if (s != null)
- return s.getEncoding();
-
- return null;
- }
-
- /*
- * @see IUpdate#update()
- */
- public void update() {
-
- if (fEncoding == null) {
- setEnabled(false);
- return;
- }
-
- ITextEditor editor= getTextEditor();
- if (editor == null) {
- setEnabled(false);
- return;
- }
-
- // update label
- fIsDefault= IEncodingActionsConstants.DEFAULT.equals(fEncoding);
- if (fIsDefault)
- setText(getDefaultEncodingText(editor, fLabel));
- else
- setText(fLabel);
-
- // update enable state
- if (editor.isDirty())
- setEnabled(false);
- else
- setEnabled(true);
-
- // update checked state
- String current= getEncoding(editor);
- if (fIsDefault)
- setChecked(current == null);
- else
- setChecked(fEncoding.equals(current));
- }
-
- }
-
- /*
- * @since 3.0
- */
- private static String getDefaultEncodingText(ITextEditor editor, String defaultText) {
- IEditorInput input= (editor.getEditorInput());
- if (!(input instanceof IFileEditorInput))
- return defaultText;
-
- IFile file= ((IFileEditorInput)input).getFile();
-
- String format= format= FILE_CONTENT_ENCODING_FORMAT;
- String encoding;
- try {
- encoding= getEncodingFromContent(file);
- if (encoding == null) {
- format= FILE_CONTAINER_ENCODING_FORMAT;
- encoding= file.getParent().getDefaultCharset();
- }
- } catch (CoreException ex) {
- return defaultText;
- }
-
- return MessageFormat.format(format, new String[] { encoding });
- }
-
- /*
- * @since 3.0
- */
- private static String getEncodingFromContent(IFile file) throws CoreException {
- IContentDescription description = file.getContentDescription();
- if (description != null) {
- byte[] bom= (byte[])description.getProperty(IContentDescription.BYTE_ORDER_MARK);
- if (bom == null)
- return (String)description.getProperty(IContentDescription.CHARSET);
- if (bom == IContentDescription.BOM_UTF_8)
- return TextEditorMessages.getString("WorkbenchPreference.encoding.BOM_UTF_8"); //$NON-NLS-1$
- if (bom == IContentDescription.BOM_UTF_16BE)
- return TextEditorMessages.getString("WorkbenchPreference.encoding.BOM_UTF_16BE"); //$NON-NLS-1$
- if (bom == IContentDescription.BOM_UTF_16LE)
- return TextEditorMessages.getString("WorkbenchPreference.encoding.BOM_UTF_16LE"); //$NON-NLS-1$
- }
-
- return null;
- }
-
- /**
- * Sets the encoding of an editor to the value that has interactively been defined.
- */
- static class CustomEncodingAction extends TextEditorAction {
-
-
- /*
- * @see org.eclipse.ui.texteditor.TextEditorAction#TextEditorAction(ResourceBundle, String, ITextEditor)
- */
- protected CustomEncodingAction(ResourceBundle bundle, String prefix, ITextEditor editor) {
- super(bundle, prefix, editor);
- }
-
- /*
- * @see IUpdate#update()
- */
- public void update() {
- ITextEditor editor= getTextEditor();
- setEnabled(editor != null && !editor.isDirty());
- }
-
- /*
- * @see IAction#run()
- */
- public void run() {
-
- ITextEditor editor= getTextEditor();
- if (editor == null)
- return;
-
- IEncodingSupport encodingSupport= (IEncodingSupport) editor.getAdapter(IEncodingSupport.class);
- if (encodingSupport == null)
- return;
-
- String title= TextEditorMessages.getString("Editor.ConvertEncoding.Custom.dialog.title"); //$NON-NLS-1$
- String message= TextEditorMessages.getString("Editor.ConvertEncoding.Custom.dialog.message"); //$NON-NLS-1$
- IInputValidator inputValidator = new IInputValidator() {
- public String isValid(String newText) {
- return (newText == null || newText.length() == 0) ? " " : null; //$NON-NLS-1$
- }
- };
-
- String initialValue= encodingSupport.getEncoding();
- if (initialValue == null)
- initialValue= encodingSupport.getDefaultEncoding();
- if (initialValue == null)
- initialValue= ""; //$NON-NLS-1$
-
- InputDialog d= new InputDialog(editor.getSite().getShell(), title, message, initialValue, inputValidator); //$NON-NLS-1$
- if (d.open() == Window.OK)
- encodingSupport.setEncoding(d.getValue());
- }
- }
-
-
- /** List of predefined encodings. */
- private static final String[][] ENCODINGS;
-
- /** The default encoding. */
- private static final String SYSTEM_ENCODING;
-
- /**
- * Initializer: computes the set of predefined encoding actions.
- */
- static {
-
- String[][] encodings= {
- { IEncodingActionsConstants.DEFAULT, IEncodingActionsHelpContextIds.DEFAULT, IEncodingActionsDefinitionIds.DEFAULT },
- { IEncodingActionsConstants.US_ASCII, IEncodingActionsHelpContextIds.US_ASCII, IEncodingActionsDefinitionIds.US_ASCII },
- { IEncodingActionsConstants.ISO_8859_1, IEncodingActionsHelpContextIds.ISO_8859_1, IEncodingActionsDefinitionIds.ISO_8859_1 },
- { IEncodingActionsConstants.UTF_8, IEncodingActionsHelpContextIds.UTF_8, IEncodingActionsDefinitionIds.UTF_8 },
- { IEncodingActionsConstants.UTF_16BE, IEncodingActionsHelpContextIds.UTF_16BE, IEncodingActionsDefinitionIds.UTF_16BE },
- { IEncodingActionsConstants.UTF_16LE, IEncodingActionsHelpContextIds.UTF_16LE, IEncodingActionsDefinitionIds.UTF_16LE },
- { IEncodingActionsConstants.UTF_16, IEncodingActionsHelpContextIds.UTF_16, IEncodingActionsDefinitionIds.UTF_16 }
- };
-
- String system= System.getProperty("file.encoding"); //$NON-NLS-1$
- if (system != null) {
-
- int i;
- for (i= 0; i < encodings.length; i++) {
- if (encodings[i][0].equals(system))
- break;
- }
-
- if (i != encodings.length) {
- // bring system encoding in second position - first is default encoding
- String[] s= encodings[i];
- encodings[i]= encodings[1];
- encodings[1]= s;
- // forget system encoding as it's already in the list
- system= null;
- }
- }
-
- SYSTEM_ENCODING= system;
- ENCODINGS= encodings;
- }
-
-
-
- /** List of encoding actions of this group. */
- private List fRetargetActions= new ArrayList();
-
- /**
- * Creates a new encoding action group for an action bar contributor.
- */
- public EncodingActionGroup() {
-
- ResourceBundle b= TextEditorMessages.getResourceBundle();
-
- fRetargetActions.add(new RetargetTextEditorAction(b, "Editor.ConvertEncoding." + ENCODINGS[0][0] + ".", ENCODINGS[0][0], IAction.AS_RADIO_BUTTON)); //$NON-NLS-1$ //$NON-NLS-2$
-
- if (SYSTEM_ENCODING != null)
- fRetargetActions.add(new RetargetTextEditorAction(b, "Editor.ConvertEncoding.System.", IEncodingActionsConstants.SYSTEM, IAction.AS_RADIO_BUTTON)); //$NON-NLS-1$
-
- for (int i= 1; i < ENCODINGS.length; i++)
- fRetargetActions.add(new RetargetTextEditorAction(b, "Editor.ConvertEncoding." + ENCODINGS[i][0] + ".", ENCODINGS[i][0], IAction.AS_RADIO_BUTTON)); //$NON-NLS-1$ //$NON-NLS-2$
-
- fRetargetActions.add(new RetargetTextEditorAction(b, "Editor.ConvertEncoding.Custom.", IEncodingActionsConstants.CUSTOM, IAction.AS_PUSH_BUTTON)); //$NON-NLS-1$
- }
-
- /*
- * @see ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
- */
- public void fillActionBars(IActionBars actionBars) {
- IMenuManager menuManager= actionBars.getMenuManager();
- IMenuManager editMenu= menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- if (editMenu != null && fRetargetActions.size() > 0) {
- MenuManager subMenu= new MenuManager(TextEditorMessages.getString("Editor.ConvertEncoding.submenu.label")); //$NON-NLS-1$
- subMenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- update();
- }
- });
-
- Iterator e= fRetargetActions.iterator();
- subMenu.add((IAction) e.next());
- subMenu.add(new Separator());
- while (e.hasNext())
- subMenu.add((IAction) e.next());
-
- editMenu.add(subMenu);
- }
- }
-
- /**
- * Retargets this action group to the given editor.
- *
- * @param editor the text editor to which the group should be retargeted
- */
- public void retarget(ITextEditor editor) {
- fTextEditor= editor;
- Iterator e= fRetargetActions.iterator();
- while (e.hasNext()) {
- RetargetTextEditorAction a= (RetargetTextEditorAction) e.next();
- a.setAction(editor == null ? null : editor.getAction(a.getId()));
- }
- }
-
-
- //------------------------------------------------------------------------------------------
-
-
- /** Text editor this group is associated with. */
- private ITextEditor fTextEditor;
-
- /**
- * Creates a new encoding action group for the given editor.
- *
- * @param editor the text editor
- */
- public EncodingActionGroup(ITextEditor editor) {
-
- fTextEditor= editor;
- ResourceBundle b= TextEditorMessages.getResourceBundle();
-
- ResourceAction a;
- if (SYSTEM_ENCODING != null) {
- a= new PredefinedEncodingAction(b, SYSTEM_ENCODING, editor);
- a.setHelpContextId(IEncodingActionsHelpContextIds.SYSTEM);
- a.setActionDefinitionId(IEncodingActionsDefinitionIds.SYSTEM);
- editor.setAction(IEncodingActionsConstants.SYSTEM, a);
- }
-
- for (int i= 0; i < ENCODINGS.length; i++) {
- a= new PredefinedEncodingAction(b, "Editor.ConvertEncoding." + ENCODINGS[i][0] + ".", ENCODINGS[i][0], editor); //$NON-NLS-1$ //$NON-NLS-2$
- a.setHelpContextId( ENCODINGS[i][1]);
- a.setActionDefinitionId( ENCODINGS[i][2]);
- editor.setAction(ENCODINGS[i][0], a);
- }
-
- a= new CustomEncodingAction(b, "Editor.ConvertEncoding." + IEncodingActionsConstants.CUSTOM + ".", editor); //$NON-NLS-1$ //$NON-NLS-2$
- a.setHelpContextId(IEncodingActionsHelpContextIds.CUSTOM);
- a.setActionDefinitionId(IEncodingActionsDefinitionIds.CUSTOM);
- editor.setAction(IEncodingActionsConstants.CUSTOM, a);
- }
-
- /**
- * Updates all actions of this action group.
- */
- public void update() {
- if (fTextEditor == null)
- return;
-
- IAction a= fTextEditor.getAction(IEncodingActionsConstants.SYSTEM);
- if (a instanceof IUpdate)
- ((IUpdate) a).update();
-
- for (int i= 0; i < ENCODINGS.length; i++) {
- a= fTextEditor.getAction(ENCODINGS[i][0]);
- if (a instanceof IUpdate)
- ((IUpdate) a).update();
- }
-
- a= fTextEditor.getAction(IEncodingActionsConstants.CUSTOM);
- if (a instanceof IUpdate)
- ((IUpdate) a).update();
- }
-
- /*
- * @see ActionGroup#dispose()
- */
- public void dispose() {
- if (fTextEditor != null) {
- fTextEditor.setAction(IEncodingActionsConstants.SYSTEM, null);
- for (int i= 0; i < ENCODINGS.length; i++)
- fTextEditor.setAction(ENCODINGS[i][0], null);
- fTextEditor.setAction(IEncodingActionsConstants.CUSTOM, null);
-
- fTextEditor= null;
- }
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java
deleted file mode 100644
index 85679f1b3..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileDocumentProvider.java
+++ /dev/null
@@ -1,1053 +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.ui.editors.text;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-
-import org.eclipse.core.internal.filebuffers.ContainerGenerator;
-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.IResourceRuleFactory;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-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.runtime.jobs.ISchedulingRule;
-
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.jface.operation.IRunnableContext;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner;
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
-import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
-
-
-/**
- * Shared document provider specialized for file resources (<code>IFile</code>).
- * <p>
- * This class may be instantiated or be subclassed.</p>
- */
-public class FileDocumentProvider extends StorageDocumentProvider {
-
- /**
- * Qualified name for the encoding key.
- *
- * @since 2.1
- */
- private static final QualifiedName ENCODING_KEY = new QualifiedName(EditorsUI.PLUGIN_ID, "encoding"); //$NON-NLS-1$
- /**
- * Constant denoting UTF-8 encoding.
- * @since 3.0
- */
- private static final String CHARSET_UTF_8= "UTF-8"; //$NON-NLS-1$
-
-
- /**
- * The runnable context for that provider.
- * @since 3.0
- */
- private WorkspaceOperationRunner fOperationRunner;
- /**
- * The scheduling rule factory.
- * @since 3.0
- */
- private IResourceRuleFactory fResourceRuleFactory;
-
- /**
- * 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.
- *
- * @since 2.0
- */
- protected class SafeChange implements Runnable {
-
- /** The input that changes. */
- private IFileEditorInput fInput;
-
- /**
- * Creates a new safe runnable for the given input.
- *
- * @param input the input
- */
- public SafeChange(IFileEditorInput input) {
- fInput= input;
- }
-
- /**
- * Execute the change.
- * Subclass responsibility.
- *
- * @param input the input
- * @throws Exception an exception in case of error
- */
- protected void execute(IFileEditorInput input) throws Exception {
- }
-
- /*
- * @see java.lang.Runnable#run()
- */
- public void run() {
-
- if (getElementInfo(fInput) == null) {
- fireElementStateChangeFailed(fInput);
- return;
- }
-
- try {
- execute(fInput);
- } catch (Exception e) {
- fireElementStateChangeFailed(fInput);
- }
- }
- }
-
-
- /**
- * Synchronizes the document with external resource changes.
- */
- protected class FileSynchronizer implements IResourceChangeListener, IResourceDeltaVisitor {
-
- /** The file editor input. */
- protected IFileEditorInput fFileEditorInput;
- /**
- * A flag indicating whether this synchronizer is installed or not.
- *
- * @since 2.1
- */
- protected boolean fIsInstalled= false;
-
- /**
- * Creates a new file synchronizer. Is not yet installed on a resource.
- *
- * @param fileEditorInput the editor input to be synchronized
- */
- public FileSynchronizer(IFileEditorInput fileEditorInput) {
- fFileEditorInput= fileEditorInput;
- }
-
- /**
- * Creates a new file synchronizer which is not yet installed on a resource.
- *
- * @param fileEditorInput the editor input to be synchronized
- * @deprecated use {@link FileSynchronizer#FileSynchronizer(IFileEditorInput)}
- */
- public FileSynchronizer(FileEditorInput fileEditorInput) {
- fFileEditorInput= fileEditorInput;
- }
-
- /**
- * Returns the file wrapped by the file editor input.
- *
- * @return the file wrapped by the editor input associated with that synchronizer
- */
- protected IFile getFile() {
- return fFileEditorInput.getFile();
- }
-
- /**
- * Installs the synchronizer on the input's file.
- */
- public void install() {
- getFile().getWorkspace().addResourceChangeListener(this);
- fIsInstalled= true;
- }
-
- /**
- * Uninstalls the synchronizer from the input's file.
- */
- public void uninstall() {
- getFile().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, "FileDocumentProvider.resourceChanged"); //$NON-NLS-1$
- }
- }
-
- /*
- * @see IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
- */
- public boolean visit(IResourceDelta delta) throws CoreException {
-
- if (delta != null && getFile().equals(delta.getResource())) {
-
- Runnable runnable= null;
-
- switch (delta.getKind()) {
- case IResourceDelta.CHANGED:
- if ((IResourceDelta.CONTENT & delta.getFlags()) != 0) {
- FileInfo info= (FileInfo) getElementInfo(fFileEditorInput);
- if (info != null && !info.fCanBeSaved && computeModificationStamp(getFile()) != info.fModificationStamp) {
- runnable= new SafeChange(fFileEditorInput) {
- protected void execute(IFileEditorInput input) throws Exception {
- handleElementContentChanged(input);
- }
- };
- }
- }
- break;
- case IResourceDelta.REMOVED:
- if ((IResourceDelta.MOVED_TO & delta.getFlags()) != 0) {
- final IPath path= delta.getMovedToPath();
- runnable= new SafeChange(fFileEditorInput) {
- protected void execute(IFileEditorInput input) throws Exception {
- handleElementMoved(input, path);
- }
- };
- } else {
- FileInfo info= (FileInfo) getElementInfo(fFileEditorInput);
- if (info != null && !info.fCanBeSaved) {
- runnable= new SafeChange(fFileEditorInput) {
- protected void execute(IFileEditorInput input) throws Exception {
- handleElementDeleted(input);
- }
- };
- }
- }
- break;
- }
-
- if (runnable != null)
- update(runnable);
- }
-
- return true; // because we are sitting on files anyway
- }
-
- /**
- * Posts the update code "behind" the running operation.
- *
- * @param runnable the update code
- */
- protected void update(Runnable runnable) {
-
- if (runnable instanceof SafeChange)
- fireElementStateChanging(fFileEditorInput);
-
- IWorkbench workbench= PlatformUI.getWorkbench();
- IWorkbenchWindow[] windows= workbench.getWorkbenchWindows();
- if (windows != null && windows.length > 0) {
- Display display= windows[0].getShell().getDisplay();
- display.asyncExec(runnable);
- } else {
- runnable.run();
- }
- }
- }
-
-
-
- /**
- * Bundle of all required information to allow files as underlying document resources.
- */
- protected class FileInfo extends StorageInfo {
-
- /** The file synchronizer. */
- public FileSynchronizer fFileSynchronizer;
- /** The time stamp at which this provider changed the file. */
- public long fModificationStamp= IResource.NULL_STAMP;
- /**
- * Tells whether the file on disk has a BOM.
- */
- private boolean fHasBOM;
-
- /**
- * Creates and returns a new file info.
- *
- * @param document the document
- * @param model the annotation model
- * @param fileSynchronizer the file synchronizer
- */
- public FileInfo(IDocument document, IAnnotationModel model, FileSynchronizer fileSynchronizer) {
- super(document, model);
- fFileSynchronizer= fileSynchronizer;
- }
- }
-
-
- /**
- * Creates and returns a new document provider.
- */
- public FileDocumentProvider() {
- super();
- fResourceRuleFactory= ResourcesPlugin.getWorkspace().getRuleFactory();
- }
-
- /**
- * Overrides <code>StorageDocumentProvider#setDocumentContent(IDocument, IEditorInput)</code>.
- *
- * @see StorageDocumentProvider#setDocumentContent(IDocument, IEditorInput)
- * @deprecated use file encoding based version
- * @since 2.0
- */
- protected boolean setDocumentContent(IDocument document, IEditorInput editorInput) throws CoreException {
- if (editorInput instanceof IFileEditorInput) {
- IFile file= ((IFileEditorInput) editorInput).getFile();
- setDocumentContent(document, file.getContents(false));
- return true;
- }
- return super.setDocumentContent(document, editorInput);
- }
-
- /*
- * @see StorageDocumentProvider#setDocumentContent(IDocument, IEditorInput, String)
- * @since 2.0
- */
- protected boolean setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) throws CoreException {
- if (editorInput instanceof IFileEditorInput) {
- IFile file= ((IFileEditorInput) editorInput).getFile();
- InputStream contentStream= file.getContents(false);
-
- FileInfo info= (FileInfo)getElementInfo(editorInput);
-
- /*
- * 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 (info != null && info.fHasBOM && CHARSET_UTF_8.equals(encoding)) {
- try {
- contentStream.read(new byte[IContentDescription.BOM_UTF_8.length]);
- } catch (IOException e) {
- // ignore if we cannot remove BOM
- }
- }
-
- setDocumentContent(document, contentStream, encoding);
- return true;
- }
- return super.setDocumentContent(document, editorInput, encoding);
- }
-
- /*
- * @see AbstractDocumentProvider#createAnnotationModel(Object)
- */
- protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
- if (element instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) element;
- return new ResourceMarkerAnnotationModel(input.getFile());
- }
-
- return super.createAnnotationModel(element);
- }
-
- /**
- * Checks whether the given resource has been changed on the
- * local file system by comparing the actual time stamp with the
- * cached one. If the resource has been changed, a <code>CoreException</code>
- * is thrown.
- *
- * @param cachedModificationStamp the cached modification stamp
- * @param resource the resource to check
- * @throws org.eclipse.core.runtime.CoreException if resource has been changed on the file system
- */
- protected void checkSynchronizationState(long cachedModificationStamp, IResource resource) throws CoreException {
- if (cachedModificationStamp != computeModificationStamp(resource)) {
- Status status= new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IResourceStatus.OUT_OF_SYNC_LOCAL, TextEditorMessages.getString("FileDocumentProvider.error.out_of_sync"), null); //$NON-NLS-1$
- throw new CoreException(status);
- }
- }
-
- /**
- * Computes the initial modification stamp for the given resource.
- *
- * @param resource the resource
- * @return the modification stamp
- */
- protected long computeModificationStamp(IResource resource) {
- long modificationStamp= resource.getModificationStamp();
-
- IPath path= resource.getLocation();
- if (path == null)
- return modificationStamp;
-
- modificationStamp= path.toFile().lastModified();
- return modificationStamp;
- }
-
- /*
- * @see IDocumentProvider#getModificationStamp(Object)
- */
- public long getModificationStamp(Object element) {
-
- if (element instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) element;
- return computeModificationStamp(input.getFile());
- }
-
- return super.getModificationStamp(element);
- }
-
- /*
- * @see IDocumentProvider#getSynchronizationStamp(Object)
- */
- public long getSynchronizationStamp(Object element) {
-
- if (element instanceof IFileEditorInput) {
- FileInfo info= (FileInfo) getElementInfo(element);
- if (info != null)
- return info.fModificationStamp;
- }
-
- return super.getSynchronizationStamp(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#doSynchronize(java.lang.Object)
- * @since 3.0
- */
- protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException {
- if (element instanceof IFileEditorInput) {
-
- IFileEditorInput input= (IFileEditorInput) element;
-
- FileInfo info= (FileInfo) getElementInfo(element);
- if (info != null) {
-
- if (info.fFileSynchronizer != null) {
- info.fFileSynchronizer.uninstall();
- refreshFile(input.getFile(), monitor);
- info.fFileSynchronizer.install();
- } else {
- refreshFile(input.getFile(), monitor);
- }
-
- handleElementContentChanged((IFileEditorInput) element);
- }
- return;
-
- }
- super.doSynchronize(element, monitor);
- }
-
- /*
- * @see IDocumentProvider#isDeleted(Object)
- */
- public boolean isDeleted(Object element) {
-
- if (element instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) element;
-
- IPath path= input.getFile().getLocation();
- if (path == null)
- return true;
-
- return !path.toFile().exists();
- }
-
- return super.isDeleted(element);
- }
-
- /*
- * @see AbstractDocumentProvider#doSaveDocument(IProgressMonitor, Object, IDocument, boolean)
- */
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
- if (element instanceof IFileEditorInput) {
-
- IFileEditorInput input= (IFileEditorInput) element;
- String encoding= null;
- try {
- FileInfo info= (FileInfo) getElementInfo(element);
- IFile file= input.getFile();
- encoding= getCharsetForNewFile(file, document, info);
-
- byte[] bytes= document.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 (info != null && info.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 (file.exists()) {
-
- if (info != null && !overwrite)
- checkSynchronizationState(info.fModificationStamp, file);
-
- // inform about the upcoming content change
- fireElementStateChanging(element);
- try {
- file.setContents(stream, overwrite, true, monitor);
- } catch (CoreException x) {
- // inform about failure
- fireElementStateChangeFailed(element);
- throw x;
- } catch (RuntimeException x) {
- // inform about failure
- fireElementStateChangeFailed(element);
- throw x;
- }
-
- // If here, the editor state will be flipped to "not dirty".
- // Thus, the state changing flag will be reset.
-
- if (info != null) {
-
- ResourceMarkerAnnotationModel model= (ResourceMarkerAnnotationModel) info.fModel;
- model.updateMarkers(info.fDocument);
-
- info.fModificationStamp= computeModificationStamp(file);
- }
-
- } else {
- try {
- monitor.beginTask(TextEditorMessages.getString("FileDocumentProvider.task.saving"), 2000); //$NON-NLS-1$
- ContainerGenerator generator = new ContainerGenerator(file.getWorkspace(), file.getParent().getFullPath());
- generator.generateContainer(new SubProgressMonitor(monitor, 1000));
- file.create(stream, false, new SubProgressMonitor(monitor, 1000));
- }
- finally {
- monitor.done();
- }
- }
-
- } catch (UnsupportedEncodingException x) {
- String message= TextEditorMessages.getFormattedString("Editor.error.unsupported_encoding.message_arg", encoding); //$NON-NLS-1$
- IStatus s= new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, message, x);
- throw new CoreException(s);
- }
-
- } else {
- super.doSaveDocument(monitor, element, document, overwrite);
- }
- }
-
- /*
- * @since 3.0
- */
- private String getCharsetForNewFile(IFile targetFile, IDocument document, FileInfo info) {
- // User-defined encoding has first priority
- String encoding;
- try {
- encoding= targetFile.getCharset(false);
- } catch (CoreException ex) {
- encoding= null;
- }
- if (encoding != null)
- return encoding;
-
- // Probe content
- Reader reader= new BufferedReader(new StringReader(document.get()));
- try {
- QualifiedName[] options= new QualifiedName[] { IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK };
- IContentDescription description= Platform.getContentTypeManager().getDescriptionFor(reader, targetFile.getName(), options);
- if (description != null) {
- encoding= description.getCharset();
- if (encoding != null)
- return encoding;
- }
- } catch (IOException ex) {
- // continue with next strategy
- } finally {
- try {
- reader.close();
- } catch (IOException ex) {
- TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, "TextFileDocumentProvider.getCharsetForNewFile(...): Could not close reader", ex)); //$NON-NLS-1$
- }
- }
-
- // Use file's encoding if the file has a BOM
- if (info != null && info.fHasBOM)
- return info.fEncoding;
-
- // Use parent chain
- try {
- return targetFile.getParent().getDefaultCharset();
- } catch (CoreException ex) {
- // Use global default
- return ResourcesPlugin.getEncoding();
- }
- }
-
- /*
- * @see AbstractDocumentProvider#createElementInfo(Object)
- */
- protected ElementInfo createElementInfo(Object element) throws CoreException {
- if (element instanceof IFileEditorInput) {
-
- IFileEditorInput input= (IFileEditorInput) element;
-
- try {
- refreshFile(input.getFile());
- } catch (CoreException x) {
- handleCoreException(x,TextEditorMessages.getString("FileDocumentProvider.createElementInfo")); //$NON-NLS-1$
- }
-
- IDocument d= null;
- IStatus s= null;
-
- try {
- d= createDocument(element);
- } catch (CoreException x) {
- s= x.getStatus();
- d= createEmptyDocument();
- }
-
- IAnnotationModel m= createAnnotationModel(element);
- FileSynchronizer f= new FileSynchronizer(input);
- f.install();
-
- FileInfo info= new FileInfo(d, m, f);
- info.fModificationStamp= computeModificationStamp(input.getFile());
- info.fStatus= s;
- info.fEncoding= getPersistedEncoding(input);
- info.fHasBOM= hasBOM(input);
-
- return info;
- }
-
- return super.createElementInfo(element);
- }
-
- /*
- * @see AbstractDocumentProvider#disposeElementInfo(Object, ElementInfo)
- */
- protected void disposeElementInfo(Object element, ElementInfo info) {
- if (info instanceof FileInfo) {
- FileInfo fileInfo= (FileInfo) info;
- if (fileInfo.fFileSynchronizer != null)
- fileInfo.fFileSynchronizer.uninstall();
- }
-
- super.disposeElementInfo(element, info);
- }
-
- /**
- * Updates the element info to a change of the file content and sends out
- * appropriate notifications.
- *
- * @param fileEditorInput the input of an text editor
- */
- protected void handleElementContentChanged(IFileEditorInput fileEditorInput) {
- FileInfo info= (FileInfo) getElementInfo(fileEditorInput);
- if (info == null)
- return;
-
- IDocument document= createEmptyDocument();
- IStatus status= null;
-
- try {
-
- try {
- refreshFile(fileEditorInput.getFile());
- } catch (CoreException x) {
- handleCoreException(x, "FileDocumentProvider.handleElementContentChanged"); //$NON-NLS-1$
- }
-
- setDocumentContent(document, fileEditorInput, info.fEncoding);
-
- } catch (CoreException x) {
- status= x.getStatus();
- }
-
- String newContent= document.get();
-
- if ( !newContent.equals(info.fDocument.get())) {
-
- // set the new content and fire content related events
- fireElementContentAboutToBeReplaced(fileEditorInput);
-
- removeUnchangedElementListeners(fileEditorInput, info);
-
- info.fDocument.removeDocumentListener(info);
- info.fDocument.set(newContent);
- info.fCanBeSaved= false;
- info.fModificationStamp= computeModificationStamp(fileEditorInput.getFile());
- info.fStatus= status;
-
- addUnchangedElementListeners(fileEditorInput, info);
-
- fireElementContentReplaced(fileEditorInput);
-
- } else {
-
- removeUnchangedElementListeners(fileEditorInput, info);
-
- // fires only the dirty state related event
- info.fCanBeSaved= false;
- info.fModificationStamp= computeModificationStamp(fileEditorInput.getFile());
- info.fStatus= status;
-
- addUnchangedElementListeners(fileEditorInput, info);
-
- fireElementDirtyStateChanged(fileEditorInput, false);
- }
- }
-
- /**
- * Sends out the notification that the file serving as document input has been moved.
- *
- * @param fileEditorInput the input of an text editor
- * @param path the path of the new location of the file
- */
- protected void handleElementMoved(IFileEditorInput fileEditorInput, IPath path) {
- IWorkspace workspace= ResourcesPlugin.getWorkspace();
- IFile newFile= workspace.getRoot().getFile(path);
- fireElementMoved(fileEditorInput, newFile == null ? null : new FileEditorInput(newFile));
- }
-
- /**
- * Sends out the notification that the file serving as document input has been deleted.
- *
- * @param fileEditorInput the input of an text editor
- */
- protected void handleElementDeleted(IFileEditorInput fileEditorInput) {
- fireElementDeleted(fileEditorInput);
- }
-
- /*
- * @see AbstractDocumentProvider#getElementInfo(Object)
- * It's only here to circumvent visibility issues with certain compilers.
- */
- protected ElementInfo getElementInfo(Object element) {
- return super.getElementInfo(element);
- }
-
- /*
- * @see AbstractDocumentProvider#doValidateState(Object, Object)
- * @since 2.0
- */
- protected void doValidateState(Object element, Object computationContext) throws CoreException {
-
- if (element instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) element;
- FileInfo info= (FileInfo) getElementInfo(input);
- if (info != null) {
- IFile file= input.getFile();
- if (file.isReadOnly()) { // do not use cached state here
- IWorkspace workspace= file.getWorkspace();
- workspace.validateEdit(new IFile[] { file }, computationContext);
- }
- }
- }
-
- super.doValidateState(element, computationContext);
- }
-
- /*
- * @see IDocumentProviderExtension#isModifiable(Object)
- * @since 2.0
- */
- public boolean isModifiable(Object element) {
- if (!isStateValidated(element)) {
- if (element instanceof IFileEditorInput)
- return true;
- }
- return super.isModifiable(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#doResetDocument(java.lang.Object, org.eclipse.core.runtime.IProgressMonitor)
- * @since 3.0
- */
- protected void doResetDocument(Object element, IProgressMonitor monitor) throws CoreException {
- if (element instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) element;
- try {
- refreshFile(input.getFile(), monitor);
- } catch (CoreException x) {
- handleCoreException(x,TextEditorMessages.getString("FileDocumentProvider.resetDocument")); //$NON-NLS-1$
- }
- }
-
- super.doResetDocument(element, monitor);
-
- IAnnotationModel model= getAnnotationModel(element);
- if (model instanceof AbstractMarkerAnnotationModel) {
- AbstractMarkerAnnotationModel markerModel= (AbstractMarkerAnnotationModel) model;
- markerModel.resetMarkers();
- }
- }
-
- /**
- * Refreshes the given file resource.
- *
- * @param file
- * @throws CoreException if the refresh fails
- * @since 2.1
- */
- protected void refreshFile(IFile file) throws CoreException {
- refreshFile(file, getProgressMonitor());
- }
-
- /**
- * Refreshes the given file resource.
- *
- * @param file the file to be refreshed
- * @param monitor the progress monitor
- * @throws org.eclipse.core.runtime.CoreException if the refresh fails
- * @since 3.0
- */
- protected void refreshFile(IFile file, IProgressMonitor monitor) throws CoreException {
- try {
- file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- } catch (OperationCanceledException x) {
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension3#isSynchronized(java.lang.Object)
- * @since 3.0
- */
- public boolean isSynchronized(Object element) {
- if (element instanceof IFileEditorInput) {
- if (getElementInfo(element) != null) {
- IFileEditorInput input= (IFileEditorInput) element;
- IResource resource= input.getFile();
- return resource.isSynchronized(IResource.DEPTH_ZERO);
- }
- return false;
- }
- return super.isSynchronized(element);
- }
-
- // --------------- Encoding support ---------------
-
- /**
- * Returns the persisted encoding for the given element.
- *
- * @param element the element for which to get the persisted encoding
- * @return the persisted encoding
- * @since 2.1
- */
- protected String getPersistedEncoding(Object element) {
- if (element instanceof IFileEditorInput) {
- IFileEditorInput editorInput= (IFileEditorInput)element;
- IFile file= editorInput.getFile();
- if (file != null) {
- String encoding= null;
- try {
- encoding= file.getPersistentProperty(ENCODING_KEY);
- } catch (CoreException x) {
- // we ignore exceptions here because we support the ENCODING_KEY property only for compatibility reasons
- }
- if (encoding != null) {
- // if we found an old encoding property, we try to migrate it to the new core.resources encoding support
- try {
- file.setCharset(encoding);
- // if successful delete old property
- file.setPersistentProperty(ENCODING_KEY, null);
- } catch (CoreException ex) {
- handleCoreException(ex, TextEditorMessages.getString("FileDocumentProvider.getPersistedEncoding")); //$NON-NLS-1$
- }
- } else {
- try {
- encoding= file.getCharset();
- } catch (CoreException e) {
- encoding= null;
- }
- }
- return encoding;
- }
- }
- return super.getPersistedEncoding(element);
- }
-
- /**
- * Persists the given encoding for the given element.
- *
- * @param element the element for which to store the persisted encoding
- * @param encoding the encoding
- * @throws org.eclipse.core.runtime.CoreException if persisting the encoding fails
- * @since 2.1
- */
- protected void persistEncoding(Object element, String encoding) throws CoreException {
- if (element instanceof IFileEditorInput) {
- IFileEditorInput editorInput= (IFileEditorInput)element;
- IFile file= editorInput.getFile();
- if (file != null) {
- file.setCharset(encoding);
- StorageInfo info= (StorageInfo)getElementInfo(element);
- if (info != null) {
- if (encoding == null)
- info.fEncoding= file.getCharset();
- if (info instanceof FileInfo)
- ((FileInfo)info).fHasBOM= hasBOM(element);
- }
- }
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#getOperationRunner(org.eclipse.core.runtime.IProgressMonitor)
- * @since 3.0
- */
- protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
- if (fOperationRunner == null)
- fOperationRunner = new WorkspaceOperationRunner();
- fOperationRunner.setProgressMonitor(monitor);
- return fOperationRunner;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#getResetRule(java.lang.Object)
- * @since 3.0
- */
- protected ISchedulingRule getResetRule(Object element) {
- if (element instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) element;
- return fResourceRuleFactory.modifyRule(input.getFile());
- } else {
- return null;
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#getSaveRule(java.lang.Object)
- * @since 3.0
- */
- protected ISchedulingRule getSaveRule(Object element) {
- if (element instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) element;
- return computeSchedulingRule(input.getFile());
- } else {
- return null;
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#getSynchronizeRule(java.lang.Object)
- * @since 3.0
- */
- protected ISchedulingRule getSynchronizeRule(Object element) {
- if (element instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) element;
- return fResourceRuleFactory.refreshRule(input.getFile());
- } else {
- return null;
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#getValidateStateRule(java.lang.Object)
- * @since 3.0
- */
- protected ISchedulingRule getValidateStateRule(Object element) {
- if (element instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) element;
- return fResourceRuleFactory.validateEditRule(new IResource[] { input.getFile() });
- } else {
- return null;
- }
- }
-
- /**
- * Returns whether the underlying file has a BOM.
- *
- * @param element the element, or <code>null</code>
- * @return <code>true</code> if the underlying file has BOM
- */
- private boolean hasBOM(Object element) {
- if (element instanceof IFileEditorInput) {
- IFile file= ((IFileEditorInput)element).getFile();
- if (file != null) {
- try {
- IContentDescription description= file.getContentDescription();
- return description != null && description.getProperty(IContentDescription.BYTE_ORDER_MARK) != null;
- } catch (CoreException ex) {
- return false;
- }
- }
- }
- return false;
- }
-
- /**
- * Reads the file's UTF-8 BOM if any and stores it.
- * <p>
- * 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>
- * @param file the file
- * @param encoding the encoding
- * @param element the element, or <code>null</code>
- * @throws org.eclipse.core.runtime.CoreException if reading the BOM fails
- * @since 3.0
- * @deprecated as of 3.0 this method is no longer in use and does nothing
- */
- protected void readUTF8BOM(IFile file, String encoding, Object element) throws CoreException {
- }
-
- /**
- * Computes the scheduling rule needed to create or modify a resource. If
- * the resource exists, its modify rule is returned. If it does not, the
- * resource hierarchy is iterated towards the workspace root to find the
- * first parent of <code>toCreateOrModify</code> that exists. Then the
- * 'create' rule for the last non-existing resource is returned.
- *
- * @param toCreateOrModify the resource to create or modify
- * @return the minimal scheduling rule needed to modify or create a resource
- */
- private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
- if (toCreateOrModify.exists()) {
- return fResourceRuleFactory.modifyRule(toCreateOrModify);
- } else {
- IResource parent= toCreateOrModify;
- do {
- toCreateOrModify= parent;
- parent= toCreateOrModify.getParent();
- } while (parent != null && !parent.exists());
-
- return fResourceRuleFactory.createRule(toCreateOrModify);
- }
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ForwardingDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ForwardingDocumentProvider.java
deleted file mode 100644
index aba57975f..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ForwardingDocumentProvider.java
+++ /dev/null
@@ -1,365 +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.ui.editors.text;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-
-import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentExtension3;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension2;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension3;
-import org.eclipse.ui.texteditor.IElementStateListener;
-
-
-/**
- * A forwarding document provider is a document provider that forwards all requests
- * to a known parent document provider. The only functional addition of the
- * forwarding document provider is that it ensures that all documents provided
- * to clients are appropriately set up.
- * <p>
- * This document provider should be used by editors that directly or indirectly
- * work with a {@link org.eclipse.ui.editors.text.TextFileDocumentProvider} and do not
- * accept that they may be provided with documents which do not contain the partitioning
- * they work on. This can happen either because of a plug-in configuration error
- * or when a user associates a file name or file extension with an existing text
- * editor and the file buffer infrastructure does not recognize that file name
- * or file extension to be of the same file type the editor works on. Thus, the
- * document provided for the files with that name or extension may not be set up
- * in the way the editor expects it. The <code>ForwardingDocumentProvider</code>
- * compensates for that situation.
- * </p>
- * <p>
- * Editors that directly work with a {@link org.eclipse.ui.editors.text.TextFileDocumentProvider} can
- * now use a <code>ForwardingDocumentProvider</code> instead and configure a
- * {@link org.eclipse.ui.editors.text.TextFileDocumentProvider} as its parent provider. Editors that
- * indirectly work with a {@link org.eclipse.ui.editors.text.TextFileDocumentProvider}, e.g. never
- * set a document provider explicitly, should explicitly set a
- * <code>ForwardingDocumentProvider</code> as document provider. In this case
- * the forwarding document provider may not be shared between editors.
- * </p>
- *
- * @since 3.0
- */
-public class ForwardingDocumentProvider implements IDocumentProvider, IDocumentProviderExtension, IDocumentProviderExtension2, IDocumentProviderExtension3, IStorageDocumentProvider {
-
- private IDocumentProvider fParentProvider;
- private String fPartitioning;
- private IDocumentSetupParticipant fDocumentSetupParticipant;
- private boolean fAllowSetParentProvider;
-
-
- /**
- * Creates a new forwarding document provider with a fixed parent document provider. Calling
- * {@link #setParentProvider(IDocumentProvider)} does not have any effect on this object.
- *
- * @param partitioning the partitioning
- * @param documentSetupParticipant the document setup participant
- * @param parentProvider the parent document provider
- */
- public ForwardingDocumentProvider(String partitioning, IDocumentSetupParticipant documentSetupParticipant, IDocumentProvider parentProvider) {
- fPartitioning= partitioning;
- fDocumentSetupParticipant= documentSetupParticipant;
- fParentProvider= parentProvider;
- fAllowSetParentProvider= false;
- }
-
- /**
- * Creates a new forwarding document provider with a dynamically changeable
- * parent provider. Forwarding document providers created with that method
- * are not allowed to be shared by multiple editors.
- *
- * @param partitioning the partitioning
- * @param documentSetupParticipant the document setup participant
- */
- public ForwardingDocumentProvider(String partitioning, IDocumentSetupParticipant documentSetupParticipant) {
- fPartitioning= partitioning;
- fDocumentSetupParticipant= documentSetupParticipant;
- fAllowSetParentProvider= true;
- }
-
- /**
- * Sets the parent document provider. This method has only an effect if the
- * forwarding document provider has accordingly be created.
- *
- * @param parentProvider the new parent document provider
- */
- public void setParentProvider(IDocumentProvider parentProvider) {
- if (fAllowSetParentProvider)
- fParentProvider= parentProvider;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#connect(java.lang.Object)
- */
- public void connect(Object element) throws CoreException {
- fParentProvider.connect(element);
- IDocument document= fParentProvider.getDocument(element);
- if (document instanceof IDocumentExtension3) {
- IDocumentExtension3 extension= (IDocumentExtension3) document;
- if (extension.getDocumentPartitioner(fPartitioning) == null)
- fDocumentSetupParticipant.setup(document);
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#disconnect(java.lang.Object)
- */
- public void disconnect(Object element) {
- fParentProvider.disconnect(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getDocument(java.lang.Object)
- */
- public IDocument getDocument(Object element) {
- return fParentProvider.getDocument(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#resetDocument(java.lang.Object)
- */
- public void resetDocument(Object element) throws CoreException {
- fParentProvider.resetDocument(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#saveDocument(org.eclipse.core.runtime.IProgressMonitor, java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
- */
- public void saveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
- fParentProvider.saveDocument(monitor, element, document, overwrite);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getModificationStamp(java.lang.Object)
- */
- public long getModificationStamp(Object element) {
- return fParentProvider.getModificationStamp(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getSynchronizationStamp(java.lang.Object)
- */
- public long getSynchronizationStamp(Object element) {
- return fParentProvider.getSynchronizationStamp(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#isDeleted(java.lang.Object)
- */
- public boolean isDeleted(Object element) {
- return fParentProvider.isDeleted(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#mustSaveDocument(java.lang.Object)
- */
- public boolean mustSaveDocument(Object element) {
- return fParentProvider.mustSaveDocument(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#canSaveDocument(java.lang.Object)
- */
- public boolean canSaveDocument(Object element) {
- return fParentProvider.canSaveDocument(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getAnnotationModel(java.lang.Object)
- */
- public IAnnotationModel getAnnotationModel(Object element) {
- return fParentProvider.getAnnotationModel(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#aboutToChange(java.lang.Object)
- */
- public void aboutToChange(Object element) {
- fParentProvider.aboutToChange(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#changed(java.lang.Object)
- */
- public void changed(Object element) {
- fParentProvider.changed(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#addElementStateListener(org.eclipse.ui.texteditor.IElementStateListener)
- */
- public void addElementStateListener(IElementStateListener listener) {
- fParentProvider.addElementStateListener(listener);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#removeElementStateListener(org.eclipse.ui.texteditor.IElementStateListener)
- */
- public void removeElementStateListener(IElementStateListener listener) {
- fParentProvider.removeElementStateListener(listener);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isReadOnly(java.lang.Object)
- */
- public boolean isReadOnly(Object element) {
- if (fParentProvider instanceof IDocumentProviderExtension) {
- IDocumentProviderExtension extension= (IDocumentProviderExtension) fParentProvider;
- return extension.isReadOnly(element);
- }
- return false;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isModifiable(java.lang.Object)
- */
- public boolean isModifiable(Object element) {
- if (fParentProvider instanceof IDocumentProviderExtension) {
- IDocumentProviderExtension extension= (IDocumentProviderExtension) fParentProvider;
- return extension.isModifiable(element);
- }
- return true;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#validateState(java.lang.Object, java.lang.Object)
- */
- public void validateState(Object element, Object computationContext) throws CoreException {
- if (fParentProvider instanceof IDocumentProviderExtension) {
- IDocumentProviderExtension extension= (IDocumentProviderExtension) fParentProvider;
- extension.validateState(element, computationContext);
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isStateValidated(java.lang.Object)
- */
- public boolean isStateValidated(Object element) {
- if (fParentProvider instanceof IDocumentProviderExtension) {
- IDocumentProviderExtension extension= (IDocumentProviderExtension) fParentProvider;
- return extension.isStateValidated(element);
- }
- return true;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#updateStateCache(java.lang.Object)
- */
- public void updateStateCache(Object element) throws CoreException {
- if (fParentProvider instanceof IDocumentProviderExtension) {
- IDocumentProviderExtension extension= (IDocumentProviderExtension) fParentProvider;
- extension.updateStateCache(element);
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#setCanSaveDocument(java.lang.Object)
- */
- public void setCanSaveDocument(Object element) {
- if (fParentProvider instanceof IDocumentProviderExtension) {
- IDocumentProviderExtension extension= (IDocumentProviderExtension) fParentProvider;
- extension.setCanSaveDocument(element);
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#getStatus(java.lang.Object)
- */
- public IStatus getStatus(Object element) {
- if (fParentProvider instanceof IDocumentProviderExtension) {
- IDocumentProviderExtension extension= (IDocumentProviderExtension) fParentProvider;
- return extension.getStatus(element);
- }
- return null;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#synchronize(java.lang.Object)
- */
- public void synchronize(Object element) throws CoreException {
- if (fParentProvider instanceof IDocumentProviderExtension) {
- IDocumentProviderExtension extension= (IDocumentProviderExtension) fParentProvider;
- extension.synchronize(element);
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension2#setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void setProgressMonitor(IProgressMonitor progressMonitor) {
- if (fParentProvider instanceof IDocumentProviderExtension2) {
- IDocumentProviderExtension2 extension= (IDocumentProviderExtension2) fParentProvider;
- extension.setProgressMonitor(progressMonitor);
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension2#getProgressMonitor()
- */
- public IProgressMonitor getProgressMonitor() {
- if (fParentProvider instanceof IDocumentProviderExtension2) {
- IDocumentProviderExtension2 extension= (IDocumentProviderExtension2) fParentProvider;
- return extension.getProgressMonitor();
- }
- return null;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension3#isSynchronized(java.lang.Object)
- */
- public boolean isSynchronized(Object element) {
- if (fParentProvider instanceof IDocumentProviderExtension3) {
- IDocumentProviderExtension3 extension= (IDocumentProviderExtension3) fParentProvider;
- return extension.isSynchronized(element);
- }
- return true;
- }
-
- /*
- * @see org.eclipse.ui.editors.text.IStorageDocumentProvider#getDefaultEncoding()
- */
- public String getDefaultEncoding() {
- if (fParentProvider instanceof IStorageDocumentProvider) {
- IStorageDocumentProvider provider= (IStorageDocumentProvider) fParentProvider;
- return provider.getDefaultEncoding();
- }
- return null;
- }
-
- /*
- * @see org.eclipse.ui.editors.text.IStorageDocumentProvider#getEncoding(java.lang.Object)
- */
- public String getEncoding(Object element) {
- if (fParentProvider instanceof IStorageDocumentProvider) {
- IStorageDocumentProvider provider= (IStorageDocumentProvider) fParentProvider;
- return provider.getEncoding(element);
- }
- return null;
- }
-
- /*
- * @see org.eclipse.ui.editors.text.IStorageDocumentProvider#setEncoding(java.lang.Object, java.lang.String)
- */
- public void setEncoding(Object element, String encoding) {
- if (fParentProvider instanceof IStorageDocumentProvider) {
- IStorageDocumentProvider provider= (IStorageDocumentProvider) fParentProvider;
- provider.setEncoding(element, encoding);
- }
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsConstants.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsConstants.java
deleted file mode 100644
index a0b687703..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsConstants.java
+++ /dev/null
@@ -1,77 +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.ui.editors.text;
-
-
-/**
- * Defines the names of the encoding actions.
- * <p>
- * This interface contains constants only; it is not intended to be implemented.</p>
- *
- * @since 2.0
- */
-public interface IEncodingActionsConstants {
-
- /**
- * Name of the action to change the encoding into default.
- * Value is <code>"default"</code>.
- * @since 3.0
- */
- static final String DEFAULT= "default"; //$NON-NLS-1$
-
- /**
- * Name of the action to change the encoding into US ASCII.
- * Value is <code>"US-ASCII"</code>.
- */
- static final String US_ASCII= "US-ASCII"; //$NON-NLS-1$
-
- /**
- * Name of the action to change the encoding into ISO-8859-1.
- * Value is <code>"ISO-8859-1"</code>.
- */
- static final String ISO_8859_1= "ISO-8859-1"; //$NON-NLS-1$
-
- /**
- * Name of the action to change the encoding into UTF-8.
- * Value is <code>"UTF-8"</code>.
- */
- static final String UTF_8= "UTF-8"; //$NON-NLS-1$
-
- /**
- * Name of the action to change the encoding into UTF-16BE.
- * Value is <code>"UTF-16BE"</code>.
- */
- static final String UTF_16BE= "UTF-16BE"; //$NON-NLS-1$
-
- /**
- * Name of the action to change the encoding into UTF-16LE.
- * Value is <code>"UTF-16LE"</code>.
- */
- static final String UTF_16LE= "UTF-16LE"; //$NON-NLS-1$
-
- /**
- * Name of the action to change the encoding into UTF-16.
- * Value is <code>"UTF-16"</code>.
- */
- static final String UTF_16= "UTF-16"; //$NON-NLS-1$
-
- /**
- * Name of the action to change the encoding into the system encoding.
- * Value is <code>"System"</code>.
- */
- static final String SYSTEM= "System"; //$NON-NLS-1$
-
- /**
- * Name of the action to change the encoding into a custom encoding.
- * Value is <code>"Custom"</code>.
- */
- static final String CUSTOM= "Custom"; //$NON-NLS-1$
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsDefinitionIds.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsDefinitionIds.java
deleted file mode 100644
index a83d5bd63..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsDefinitionIds.java
+++ /dev/null
@@ -1,76 +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.ui.editors.text;
-
-
-/**
- * Defines the definition IDs for the encoding actions.
- * <p>
- * This interface contains constants only; it is not intended to be implemented.</p>
- *
- * @since 2.0
- */
-public interface IEncodingActionsDefinitionIds {
- /**
- * Action definition id of the action to change the encoding into default.
- * Value is <code>"org.eclipse.ui.edit.text.encoding.default"</code>.
- * @since 3.0
- */
- public static final String DEFAULT= "org.eclipse.ui.edit.text.encoding.default"; //$NON-NLS-1$
-
- /**
- * Action definition id of the action to change the encoding into US ASCII.
- * Value is <code>"org.eclipse.ui.edit.text.encoding.us-ascii"</code>.
- */
- public static final String US_ASCII= "org.eclipse.ui.edit.text.encoding.us-ascii"; //$NON-NLS-1$
-
- /**
- * Action definition id of the action to change the encoding into ISO-8859-1.
- * Value is <code>"org.eclipse.ui.edit.text.encoding.iso-8859-1"</code>.
- */
- public static final String ISO_8859_1= "org.eclipse.ui.edit.text.encoding.iso-8859-1"; //$NON-NLS-1$
-
- /**
- * Action definition id of the action to change the encoding into UTF-8.
- * Value is <code>"org.eclipse.ui.edit.text.encoding.utf-8"</code>.
- */
- public static final String UTF_8= "org.eclipse.ui.edit.text.encoding.utf-8"; //$NON-NLS-1$
-
- /**
- * Action definition id of the action to change the encoding into UTF-16BE.
- * Value is <code>"org.eclipse.ui.edit.text.encoding.utf-16be"</code>.
- */
- public static final String UTF_16BE= "org.eclipse.ui.edit.text.encoding.utf-16be"; //$NON-NLS-1$
-
- /**
- * Action definition id of the action to change the encoding into UTF-16LE.
- * Value is <code>"org.eclipse.ui.edit.text.encoding.utf-16le"</code>.
- */
- public static final String UTF_16LE= "org.eclipse.ui.edit.text.encoding.utf-16le"; //$NON-NLS-1$
-
- /**
- * Action definition id of the action to change the encoding into UTF-16.
- * Value is <code>"org.eclipse.ui.edit.text.encoding.utf-16"</code>.
- */
- public static final String UTF_16= "org.eclipse.ui.edit.text.encoding.utf-16"; //$NON-NLS-1$
-
- /**
- * Action definition id of the action to change the encoding into the system encoding.
- * Value is <code>"org.eclipse.ui.edit.text.encoding.system"</code>.
- */
- public static final String SYSTEM= "org.eclipse.ui.edit.text.encoding.system"; //$NON-NLS-1$
-
- /**
- * Action definition id of the action to change the encoding into a custom encoding.
- * Value is <code>"org.eclipse.ui.edit.text.encoding.custom"</code>.
- */
- public static final String CUSTOM= "org.eclipse.ui.edit.text.encoding.custom"; //$NON-NLS-1$
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsHelpContextIds.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsHelpContextIds.java
deleted file mode 100644
index 5eadf6f3f..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingActionsHelpContextIds.java
+++ /dev/null
@@ -1,79 +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.ui.editors.text;
-
-import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds;
-
-
-/**
- * Help context IDs for the encoding actions.
- * <p>
- * This interface contains constants only; it is not intended to be implemented.</p>
- *
- * @since 2.0
- */
-public interface IEncodingActionsHelpContextIds {
-
- /**
- * Help id of the action to change the encoding into default.
- * Default value: <code>"org.eclipse.ui.default_action_context"</code>
- * @since 3.0
- */
- public static final String DEFAULT= IAbstractTextEditorHelpContextIds.PREFIX + IEncodingActionsConstants.DEFAULT + IAbstractTextEditorHelpContextIds.ACTION_POSTFIX;
-
- /**
- * Help id of the action to change the encoding into US ASCII.
- * Default value: <code>"org.eclipse.ui.US-ASCII_action_context"</code>
- */
- public static final String US_ASCII= IAbstractTextEditorHelpContextIds.PREFIX + IEncodingActionsConstants.US_ASCII + IAbstractTextEditorHelpContextIds.ACTION_POSTFIX;
-
- /**
- * Help id of the action to change the encoding into ISO-8859-1.
- * Default value: <code>"org.eclipse.ui.ISO-8859-1_action_context"</code>
- */
- public static final String ISO_8859_1= IAbstractTextEditorHelpContextIds.PREFIX + IEncodingActionsConstants.ISO_8859_1 + IAbstractTextEditorHelpContextIds.ACTION_POSTFIX;
-
- /**
- * Help id of the action to change the encoding into UTF-8
- * Default value: <code>"org.eclipse.ui.UTF-8_action_context"</code>
- */
- public static final String UTF_8= IAbstractTextEditorHelpContextIds.PREFIX + IEncodingActionsConstants.UTF_8 + IAbstractTextEditorHelpContextIds.ACTION_POSTFIX;
-
- /**
- * Help id of the action to change the encoding into UTF-16BE.
- * Default value: <code>"org.eclipse.ui.UTF-16BE_action_context"</code>
- */
- public static final String UTF_16BE= IAbstractTextEditorHelpContextIds.PREFIX + IEncodingActionsConstants.UTF_16BE + IAbstractTextEditorHelpContextIds.ACTION_POSTFIX;
-
- /**
- * Help id of the action to change the encoding into UTF-16LE.
- * Default value: <code>"org.eclipse.ui.UTF-16LE_action_context"</code>
- */
- public static final String UTF_16LE= IAbstractTextEditorHelpContextIds.PREFIX + IEncodingActionsConstants.UTF_16LE + IAbstractTextEditorHelpContextIds.ACTION_POSTFIX;
-
- /**
- * Help id of the action to change the encoding into UTF-16.
- * Default value: <code>"org.eclipse.ui.UTF-16_action_context"</code>
- */
- public static final String UTF_16= IAbstractTextEditorHelpContextIds.PREFIX + IEncodingActionsConstants.UTF_16 + IAbstractTextEditorHelpContextIds.ACTION_POSTFIX;
-
- /**
- * Help id of the action to change the encoding into the system encoding.
- * Default value: <code>"org.eclipse.ui.System_action_context"</code>
- */
- public static final String SYSTEM= IAbstractTextEditorHelpContextIds.PREFIX + IEncodingActionsConstants.SYSTEM + IAbstractTextEditorHelpContextIds.ACTION_POSTFIX;
-
- /**
- * Help id of the action to change the encoding into a custom encoding.
- * Default value: <code>"org.eclipse.ui.Custom_action_context"</code>
- */
- public static final String CUSTOM= IAbstractTextEditorHelpContextIds.PREFIX + IEncodingActionsConstants.CUSTOM + IAbstractTextEditorHelpContextIds.ACTION_POSTFIX;
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingSupport.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingSupport.java
deleted file mode 100644
index 56e207be2..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IEncodingSupport.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.ui.editors.text;
-
-
-/**
- * Interface to be implemented by objects supporting character encodings.
- *
- * @since 2.0
- */
-public interface IEncodingSupport{
-
- /**
- * Sets the character encoding.
- *
- * @param encoding the character encoding
- */
- void setEncoding(String encoding);
-
- /**
- * Returns the character encoding.
- *
- * @return the character encoding
- */
- String getEncoding();
-
- /**
- * Returns the default character encoding.
- *
- * @return the default character encoding
- */
- String getDefaultEncoding();
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IFoldingCommandIds.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IFoldingCommandIds.java
deleted file mode 100644
index 51b72f8e5..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IFoldingCommandIds.java
+++ /dev/null
@@ -1,49 +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.ui.editors.text;
-
-
-/**
- * Command IDs for folding commands.
- *
- * @since 3.0
- */
-public interface IFoldingCommandIds {
-
- /**
- * Identifier of the "collapse folded region" command.
- * <p>
- * Value: {@value}.</p>
- */
- String FOLDING_COLLAPSE= "org.eclipse.ui.edit.text.folding.collapse"; //$NON-NLS-1$
-
- /**
- * Identifier of the "expand folded region" command.
- * <p>
- * Value: {@value}.</p>
- */
- String FOLDING_EXPAND= "org.eclipse.ui.edit.text.folding.expand"; //$NON-NLS-1$
-
- /**
- * Identifier of the "expand all folded regions" command.
- * <p>
- * Value: {@value}.</p>
- */
- String FOLDING_EXPAND_ALL= "org.eclipse.ui.edit.text.folding.expand_all"; //$NON-NLS-1$
-
- /**
- * Identifier of the "toggle folding" command.
- * <p>
- * Value: {@value}.</p>
- */
- String FOLDING_TOGGLE= "org.eclipse.ui.edit.text.folding.toggle"; //$NON-NLS-1$
-
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ILocationProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ILocationProvider.java
deleted file mode 100644
index c613d24a9..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ILocationProvider.java
+++ /dev/null
@@ -1,35 +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.ui.editors.text;
-
-import org.eclipse.core.runtime.IPath;
-
-
-/**
- * This class gets the location for a given
- * object.
- *
- * @since 3.0
- */
-public interface ILocationProvider {
-
- /**
- * Returns the location of the given object or <code>null</code>.
- * <p>
- * The provided location is either a full path of a workspace resource or
- * an absolute path in the local file system.
- * </p>
- *
- * @param element the object for which to get the location
- * @return the location of the given object or <code>null</code>
- */
- IPath getPath(Object element);
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IStorageDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IStorageDocumentProvider.java
deleted file mode 100644
index f513dae2b..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/IStorageDocumentProvider.java
+++ /dev/null
@@ -1,46 +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.ui.editors.text;
-
-
-/**
- * Document provider for {@link org.eclipse.core.resources.IStorage} based domain elements.
- * Basically incorporates the concept of character encoding.
- *
- * @since 2.0
- */
-public interface IStorageDocumentProvider {
-
- /**
- * Returns the default character encoding used by this provider.
- *
- * @return the default character encoding used by this provider
- */
- String getDefaultEncoding();
-
- /**
- * Returns the character encoding for the given element, or
- * <code>null</code> if the element is not managed by this provider.
- *
- * @param element the element
- * @return the encoding for the given element
- */
- String getEncoding(Object element);
-
- /**
- * Sets the encoding for the given element. If <code>encoding</code>
- * is <code>null</code> the workbench's character encoding should be used.
- *
- * @param element the element
- * @param encoding the encoding to be used
- */
- void setEncoding(Object element, String encoding);
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ITextEditorHelpContextIds.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ITextEditorHelpContextIds.java
deleted file mode 100644
index 5bb985d3e..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/ITextEditorHelpContextIds.java
+++ /dev/null
@@ -1,49 +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.ui.editors.text;
-
-import org.eclipse.ui.ide.IDEActionFactory;
-import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds;
-
-
-/**
- * Help context IDs for the text editor.
- * <p>
- * This interface contains constants only; it is not intended to be implemented.</p>
- */
-public interface ITextEditorHelpContextIds extends IAbstractTextEditorHelpContextIds {
-
- /**
- * Id for the text editor preference page.
- * Value: <code>"org.eclipse.ui.text_editor_preference_page_context"</code>.
- */
- public static final String TEXT_EDITOR_PREFERENCE_PAGE= PREFIX + "text_editor_preference_page_context"; //$NON-NLS-1$
-
- /**
- * Id for the text editor.
- * Value: <code>"org.eclipse.ui.text_editor_context"</code>.
- */
- public static final String TEXT_EDITOR= PREFIX + "text_editor_context"; //$NON-NLS-1$
-
- /**
- * Help context id for the "Add Bookmark" action.
- * Value: <code>"org.eclipse.ui.bookmark_action_context"</code>
- * @since 3.0
- */
- public static final String BOOKMARK_ACTION= PREFIX + IDEActionFactory.BOOKMARK.getId() + ACTION_POSTFIX;
-
- /**
- * Help context id for the Add Task action.
- * Value: <code>"org.eclipse.ui.addTask_action_context"</code>
- * @since 3.0
- */
- public static final String ADD_TASK_ACTION= PREFIX + IDEActionFactory.ADD_TASK.getId() + ACTION_POSTFIX;
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/StorageDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/StorageDocumentProvider.java
deleted file mode 100644
index c14ec15d8..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/StorageDocumentProvider.java
+++ /dev/null
@@ -1,437 +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.ui.editors.text;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
-import org.osgi.framework.Bundle;
-
-import org.eclipse.core.resources.IEncodedStorage;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jface.operation.IRunnableContext;
-
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IStorageEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.AbstractDocumentProvider;
-
-
-/**
- * Shared document provider specialized for {@link org.eclipse.core.resources.IStorage}s.
- */
-public class StorageDocumentProvider extends AbstractDocumentProvider implements IStorageDocumentProvider {
-
- /**
- * Default file size.
- *
- * @since 2.1
- */
- protected final static int DEFAULT_FILE_SIZE= 15 * 1024;
-
-
- /**
- * Bundle of all required information to allow {@link org.eclipse.core.resources.IStorage} as underlying document resources.
- * @since 2.0
- */
- protected class StorageInfo extends ElementInfo {
-
- /** The flag representing the cached state whether the storage is modifiable. */
- public boolean fIsModifiable= false;
- /** The flag representing the cached state whether the storage is read-only. */
- public boolean fIsReadOnly= true;
- /** The flag representing the need to update the cached flag. */
- public boolean fUpdateCache= true;
- /** The encoding used to create the document from the storage or <code>null</code> for workbench encoding. */
- public String fEncoding;
-
- /**
- * Creates a new storage info.
- *
- * @param document the document
- * @param model the annotation model
- */
- public StorageInfo(IDocument document, IAnnotationModel model) {
- super(document, model);
- fEncoding= null;
- }
- }
-
- /**
- * Creates a new document provider.
- *
- * @since 2.0
- */
- public StorageDocumentProvider() {
- super();
- }
-
- /**
- * Initializes the given document with the given stream.
- *
- * @param document the document to be initialized
- * @param contentStream the stream which delivers the document content
- * @throws CoreException if the given stream can not be read
- *
- * @deprecated use encoding based version instead
- */
- protected void setDocumentContent(IDocument document, InputStream contentStream) throws CoreException {
- setDocumentContent(document, contentStream, null);
- }
-
- /**
- * Initializes 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
- * @throws CoreException if the given stream can not be read
- * @since 2.0
- */
- protected void setDocumentContent(IDocument document, InputStream contentStream, String encoding) throws CoreException {
-
- Reader in= null;
-
- try {
-
- if (encoding == null)
- encoding= getDefaultEncoding();
-
- in= new BufferedReader(new InputStreamReader(contentStream, encoding), DEFAULT_FILE_SIZE);
- StringBuffer buffer= new StringBuffer(DEFAULT_FILE_SIZE);
- char[] readBuffer= new char[2048];
- int n= in.read(readBuffer);
- while (n > 0) {
- buffer.append(readBuffer, 0, n);
- n= in.read(readBuffer);
- }
-
- document.set(buffer.toString());
-
- } catch (IOException x) {
- String message= (x.getMessage() != null ? x.getMessage() : ""); //$NON-NLS-1$
- IStatus s= new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, message, x);
- throw new CoreException(s);
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException x) {
- }
- }
- }
- }
-
- /**
- * Initializes the given document from the given editor input using the default character encoding.
- *
- * @param document the document to be initialized
- * @param editorInput the input from which to derive the content of the document
- * @return <code>true</code> if the document content could be set, <code>false</code> otherwise
- * @throws CoreException if the given editor input cannot be accessed
- * @deprecated use the encoding based version instead
- * @since 2.0
- */
- protected boolean setDocumentContent(IDocument document, IEditorInput editorInput) throws CoreException {
- return setDocumentContent(document, editorInput, null);
- }
-
- /**
- * Initializes the given document from the given editor input using the given character encoding.
- *
- * @param document the document to be initialized
- * @param editorInput the input from which to derive the content of the document
- * @param encoding the character encoding used to read the editor input
- * @return <code>true</code> if the document content could be set, <code>false</code> otherwise
- * @throws CoreException if the given editor input cannot be accessed
- * @since 2.0
- */
- protected boolean setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) throws CoreException {
- if (editorInput instanceof IStorageEditorInput) {
- IStorage storage= ((IStorageEditorInput) editorInput).getStorage();
- setDocumentContent(document, storage.getContents(), encoding);
- return true;
- }
- return false;
- }
-
- /*
- * @see AbstractDocumentProvider#createAnnotationModel(Object)
- */
- protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
- return null;
- }
-
- /**
- * Factory method for creating empty documents.
- * @return the newly created document
- * @since 2.1
- */
- protected IDocument createEmptyDocument() {
- return new Document();
- }
-
- /*
- * @see AbstractDocumentProvider#createDocument(Object)
- */
- protected IDocument createDocument(Object element) throws CoreException {
-
- if (element instanceof IEditorInput) {
- IDocument document= createEmptyDocument();
- if (setDocumentContent(document, (IEditorInput) element, getEncoding(element))) {
- setupDocument(element, document);
- return document;
- }
- }
-
- return null;
- }
-
- /**
- * Sets up the given document as it would be provided for the given element. The
- * content of the document is not changed. This default implementation is empty.
- * Subclasses may reimplement.
- *
- * @param element the blue-print element
- * @param document the document to set up
- * @since 3.0
- */
- protected void setupDocument(Object element, IDocument document) {
- }
-
- /*
- * @see AbstractDocumentProvider#createElementInfo(Object)
- * @since 2.0
- */
- protected ElementInfo createElementInfo(Object element) throws CoreException {
- if (element instanceof IStorageEditorInput) {
-
- IDocument document= null;
- IStatus status= null;
-
- try {
- document= createDocument(element);
- } catch (CoreException x) {
- status= x.getStatus();
- document= createEmptyDocument();
- }
-
- ElementInfo info= new StorageInfo(document, createAnnotationModel(element));
- info.fStatus= status;
- ((StorageInfo)info).fEncoding= getPersistedEncoding(element);
-
- return info;
- }
-
- return super.createElementInfo(element);
- }
-
- /*
- * @see AbstractDocumentProvider#doSaveDocument(IProgressMonitor, Object, IDocument, boolean)
- */
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
- }
-
- /**
- * 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
- * @since 2.0
- */
- protected void handleCoreException(CoreException exception, String message) {
-
- Bundle bundle = Platform.getBundle(PlatformUI.PLUGIN_ID);
- ILog log= Platform.getLog(bundle);
-
- if (message != null)
- log.log(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, message, exception));
- else
- log.log(exception.getStatus());
- }
-
- /**
- * Updates the internal cache for the given input.
- *
- * @param input the input whose cache will be updated
- * @throws CoreException if the storage cannot be retrieved from the input
- * @since 2.0
- */
- protected void updateCache(IStorageEditorInput input) throws CoreException {
- StorageInfo info= (StorageInfo) getElementInfo(input);
- if (info != null) {
- try {
- IStorage storage= input.getStorage();
- if (storage != null) {
- boolean readOnly= storage.isReadOnly();
- info.fIsReadOnly= readOnly;
- info.fIsModifiable= !readOnly;
- }
- } catch (CoreException x) {
- handleCoreException(x, TextEditorMessages.getString("StorageDocumentProvider.updateCache")); //$NON-NLS-1$
- }
- info.fUpdateCache= false;
- }
- }
-
- /*
- * @see IDocumentProviderExtension#isReadOnly(Object)
- * @since 2.0
- */
- public boolean isReadOnly(Object element) {
- if (element instanceof IStorageEditorInput) {
- StorageInfo info= (StorageInfo) getElementInfo(element);
- if (info != null) {
- if (info.fUpdateCache) {
- try {
- updateCache((IStorageEditorInput) element);
- } catch (CoreException x) {
- handleCoreException(x, TextEditorMessages.getString("StorageDocumentProvider.isReadOnly")); //$NON-NLS-1$
- }
- }
- return info.fIsReadOnly;
- }
- }
- return super.isReadOnly(element);
- }
-
- /*
- * @see IDocumentProviderExtension#isModifiable(Object)
- * @since 2.0
- */
- public boolean isModifiable(Object element) {
- if (element instanceof IStorageEditorInput) {
- StorageInfo info= (StorageInfo) getElementInfo(element);
- if (info != null) {
- if (info.fUpdateCache) {
- try {
- updateCache((IStorageEditorInput) element);
- } catch (CoreException x) {
- handleCoreException(x, TextEditorMessages.getString("StorageDocumentProvider.isModifiable")); //$NON-NLS-1$
- }
- }
- return info.fIsModifiable;
- }
- }
- return super.isModifiable(element);
- }
-
- /*
- * @see AbstractDocumentProvider#doUpdateStateCache(Object)
- * @since 2.0
- */
- protected void doUpdateStateCache(Object element) throws CoreException {
- if (element instanceof IStorageEditorInput) {
- StorageInfo info= (StorageInfo) getElementInfo(element);
- if (info != null)
- info.fUpdateCache= true;
- }
- super.doUpdateStateCache(element);
- }
-
- /*
- * @see IStorageDocumentProvider#getDefaultEncoding()
- * @since 2.0
- */
- public String getDefaultEncoding() {
- return ResourcesPlugin.getEncoding();
- }
-
- /*
- * @see IStorageDocumentProvider#getEncoding(Object)
- * @since 2.0
- */
- public String getEncoding(Object element) {
- if (element instanceof IStorageEditorInput) {
- StorageInfo info= (StorageInfo) getElementInfo(element);
- if (info != null)
- return info.fEncoding;
- else
- return getPersistedEncoding(element);
- }
- return null;
- }
-
- /*
- * @see IStorageDocumentProvider#setEncoding(Object, String)
- * @since 2.0
- */
- public void setEncoding(Object element, String encoding) {
- if (element instanceof IStorageEditorInput) {
- StorageInfo info= (StorageInfo) getElementInfo(element);
- if (info != null) {
- info.fEncoding= encoding;
- try {
- persistEncoding(element, encoding);
- } catch (CoreException ex) {
- // XXX: log
- }
- }
- }
- }
-
- /**
- * Returns the persisted encoding for the given element.
- *
- * @param element the element for which to get the persisted encoding
- * @return the persisted encoding
- * @since 2.1
- */
- protected String getPersistedEncoding(Object element) {
- if (element instanceof IStorageEditorInput) {
- IStorage storage;
- try {
- storage= ((IStorageEditorInput)element).getStorage();
- if (storage instanceof IEncodedStorage)
- return ((IEncodedStorage)storage).getCharset();
- } catch (CoreException e) {
- return null;
- }
- }
- return null;
- }
-
- /**
- * Persists the given encoding for the given element.
- *
- * @param element the element for which to store the persisted encoding
- * @param encoding the encoding
- * @throws CoreException if the operation fails
- * @since 2.1
- */
- protected void persistEncoding(Object element, String encoding) throws CoreException {
- // Default is to do nothing
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#getOperationRunner(org.eclipse.core.runtime.IProgressMonitor)
- * @since 3.0
- */
- protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
- return null;
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java
deleted file mode 100644
index 921080ca8..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java
+++ /dev/null
@@ -1,321 +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.ui.editors.text;
-
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.dialogs.SaveAsDialog;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.ConvertLineDelimitersAction;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
-import org.eclipse.ui.texteditor.IAbstractTextEditorHelpContextIds;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.ResourceAction;
-
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-
-
-/**
- * The standard text editor for file resources (<code>IFile</code>).
- * <p>
- * This editor has id <code>"org.eclipse.ui.DefaultTextEditor"</code>.
- * The editor's context menu has id <code>#TextEditorContext</code>.
- * The editor's ruler context menu has id <code>#TextRulerContext</code>.
- * </p>
- * <p>
- * The workbench will automatically instantiate this class when the default
- * editor is needed for a workbench window.
- * </p>
- */
-public class TextEditor extends AbstractDecoratedTextEditor {
-
- /**
- * The encoding support for the editor.
- * @since 2.0
- */
- protected DefaultEncodingSupport fEncodingSupport;
-
-
- /**
- * Creates a new text editor.
- */
- public TextEditor() {
- super();
- if (getSourceViewerConfiguration() == null) {
- // configuration not yet set by subclass
- setSourceViewerConfiguration(new TextSourceViewerConfiguration(getPreferenceStore()));
- }
-
- }
-
- /**
- * {@inheritDoc}
- *
- * This method configures the editor but does not define a
- * <code>SourceViewerConfiguration</code>. When only interested in
- * providing a custom source viewer configuration, subclasses may extend
- * this method.
- */
- protected void initializeEditor() {
- setEditorContextMenuId("#TextEditorContext"); //$NON-NLS-1$
- setRulerContextMenuId("#TextRulerContext"); //$NON-NLS-1$
- setHelpContextId(ITextEditorHelpContextIds.TEXT_EDITOR);
- setPreferenceStore(EditorsPlugin.getDefault().getPreferenceStore());
- configureInsertMode(SMART_INSERT, false);
- setInsertMode(INSERT);
- }
-
- /*
- * @see IWorkbenchPart#dispose()
- * @since 2.0
- */
- public void dispose() {
- if (fEncodingSupport != null) {
- fEncodingSupport.dispose();
- fEncodingSupport= null;
- }
-
- super.dispose();
- }
-
- /**
- * Installs the encoding support on the given text editor.
- * <p>
- * Subclasses may override to install their own encoding
- * support or to disable the default encoding support.
- * </p>
- * @since 2.1
- */
- protected void installEncodingSupport() {
- fEncodingSupport= new DefaultEncodingSupport();
- fEncodingSupport.initialize(this);
- }
-
- /**
- * The <code>TextEditor</code> implementation of this <code>AbstractTextEditor</code>
- * method asks the user for the workspace path of a file resource and saves the document there.
- *
- * @param progressMonitor the progress monitor to be used
- */
- protected void performSaveAs(IProgressMonitor progressMonitor) {
- Shell shell= getSite().getShell();
- IEditorInput input= getEditorInput();
-
- SaveAsDialog dialog= new SaveAsDialog(shell);
-
- IFile original= (input instanceof IFileEditorInput) ? ((IFileEditorInput) input).getFile() : null;
- if (original != null)
- dialog.setOriginalFile(original);
-
- dialog.create();
-
- IDocumentProvider provider= getDocumentProvider();
- if (provider == null) {
- // editor has programmatically been closed while the dialog was open
- return;
- }
-
- if (provider.isDeleted(input) && original != null) {
- String message= MessageFormat.format(TextEditorMessages.getString("Editor.warning.save.delete"), new Object[] { original.getName() }); //$NON-NLS-1$
- dialog.setErrorMessage(null);
- dialog.setMessage(message, IMessageProvider.WARNING);
- }
-
- if (dialog.open() == Window.CANCEL) {
- if (progressMonitor != null)
- progressMonitor.setCanceled(true);
- return;
- }
-
- IPath filePath= dialog.getResult();
- if (filePath == null) {
- if (progressMonitor != null)
- progressMonitor.setCanceled(true);
- return;
- }
-
- IWorkspace workspace= ResourcesPlugin.getWorkspace();
- IFile file= workspace.getRoot().getFile(filePath);
- final IEditorInput newInput= new FileEditorInput(file);
-
- boolean success= false;
- try {
-
- provider.aboutToChange(newInput);
- provider.saveDocument(progressMonitor, newInput, provider.getDocument(input), true);
- success= true;
-
- } catch (CoreException x) {
- IStatus status= x.getStatus();
- if (status == null || status.getSeverity() != IStatus.CANCEL) {
- String title= TextEditorMessages.getString("Editor.error.save.title"); //$NON-NLS-1$
- String msg= MessageFormat.format(TextEditorMessages.getString("Editor.error.save.message"), new Object[] { x.getMessage() }); //$NON-NLS-1$
-
- if (status != null) {
- switch (status.getSeverity()) {
- case IStatus.INFO:
- MessageDialog.openInformation(shell, title, msg);
- break;
- case IStatus.WARNING:
- MessageDialog.openWarning(shell, title, msg);
- break;
- default:
- MessageDialog.openError(shell, title, msg);
- }
- } else {
- MessageDialog.openError(shell, title, msg);
- }
- }
- } finally {
- provider.changed(newInput);
- if (success)
- setInput(newInput);
- }
-
- if (progressMonitor != null)
- progressMonitor.setCanceled(!success);
- }
-
- /*
- * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
- */
- public boolean isSaveAsAllowed() {
- return true;
- }
-
- /*
- * @see AbstractTextEditor#createActions()
- * @since 2.0
- */
- protected void createActions() {
- super.createActions();
-
- ResourceAction action= new ConvertLineDelimitersAction(TextEditorMessages.getResourceBundle(), "Editor.ConvertToWindows.", this, "\r\n"); //$NON-NLS-1$ //$NON-NLS-2$
- action.setHelpContextId(IAbstractTextEditorHelpContextIds.CONVERT_LINE_DELIMITERS_TO_WINDOWS);
- action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONVERT_LINE_DELIMITERS_TO_WINDOWS);
- setAction(ITextEditorActionConstants.CONVERT_LINE_DELIMITERS_TO_WINDOWS, action);
-
- action= new ConvertLineDelimitersAction(TextEditorMessages.getResourceBundle(), "Editor.ConvertToUNIX.", this, "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- action.setHelpContextId(IAbstractTextEditorHelpContextIds.CONVERT_LINE_DELIMITERS_TO_UNIX);
- action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONVERT_LINE_DELIMITERS_TO_UNIX);
- setAction(ITextEditorActionConstants.CONVERT_LINE_DELIMITERS_TO_UNIX, action);
-
- action= new ConvertLineDelimitersAction(TextEditorMessages.getResourceBundle(), "Editor.ConvertToMac.", this, "\r"); //$NON-NLS-1$ //$NON-NLS-2$
- action.setHelpContextId(IAbstractTextEditorHelpContextIds.CONVERT_LINE_DELIMITERS_TO_MAC);
- action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONVERT_LINE_DELIMITERS_TO_MAC);
- setAction(ITextEditorActionConstants.CONVERT_LINE_DELIMITERS_TO_MAC, action);
-
- // http://dev.eclipse.org/bugs/show_bug.cgi?id=17709
- markAsStateDependentAction(ITextEditorActionConstants.CONVERT_LINE_DELIMITERS_TO_WINDOWS, true);
- markAsStateDependentAction(ITextEditorActionConstants.CONVERT_LINE_DELIMITERS_TO_UNIX, true);
- markAsStateDependentAction(ITextEditorActionConstants.CONVERT_LINE_DELIMITERS_TO_MAC, true);
-
- installEncodingSupport();
- }
-
- /*
- * @see StatusTextEditor#getStatusHeader(IStatus)
- * @since 2.0
- */
- protected String getStatusHeader(IStatus status) {
- if (fEncodingSupport != null) {
- String message= fEncodingSupport.getStatusHeader(status);
- if (message != null)
- return message;
- }
- return super.getStatusHeader(status);
- }
-
- /*
- * @see StatusTextEditor#getStatusBanner(IStatus)
- * @since 2.0
- */
- protected String getStatusBanner(IStatus status) {
- if (fEncodingSupport != null) {
- String message= fEncodingSupport.getStatusBanner(status);
- if (message != null)
- return message;
- }
- return super.getStatusBanner(status);
- }
-
- /*
- * @see StatusTextEditor#getStatusMessage(IStatus)
- * @since 2.0
- */
- protected String getStatusMessage(IStatus status) {
- if (fEncodingSupport != null) {
- String message= fEncodingSupport.getStatusMessage(status);
- if (message != null)
- return message;
- }
- return super.getStatusMessage(status);
- }
-
- /*
- * @see AbstractTextEditor#doSetInput(IEditorInput)
- * @since 2.0
- */
- protected void doSetInput(IEditorInput input) throws CoreException {
- super.doSetInput(input);
- if (fEncodingSupport != null)
- fEncodingSupport.reset();
- }
-
- /*
- * @see IAdaptable#getAdapter(java.lang.Class)
- * @since 2.0
- */
- public Object getAdapter(Class adapter) {
- if (IEncodingSupport.class.equals(adapter))
- return fEncodingSupport;
- return super.getAdapter(adapter);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#updatePropertyDependentActions()
- * @since 2.0
- */
- protected void updatePropertyDependentActions() {
- super.updatePropertyDependentActions();
- if (fEncodingSupport != null)
- fEncodingSupport.reset();
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
- * @since 3.0
- */
- protected void editorContextMenuAboutToShow(IMenuManager menu) {
- super.editorContextMenuAboutToShow(menu);
- addAction(menu, ITextEditorActionConstants.GROUP_EDIT, ITextEditorActionConstants.SHIFT_RIGHT);
- addAction(menu, ITextEditorActionConstants.GROUP_EDIT, ITextEditorActionConstants.SHIFT_LEFT);
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorActionContributor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorActionContributor.java
deleted file mode 100644
index a2119dc8a..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorActionContributor.java
+++ /dev/null
@@ -1,126 +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.ui.editors.text;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.ide.IDEActionFactory;
-import org.eclipse.ui.texteditor.BasicTextEditorActionContributor;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-
-
-/**
- * Manages the installation and de-installation of global actions for the default text editor.
- * <p>
- * If instantiated and used as-is, this contributor connects global actions and adds actions
- * for line delimiter conversion and encoding support.</p>
- *
- * @since 2.0
- */
-public class TextEditorActionContributor extends BasicTextEditorActionContributor {
-
- /** Convert to Windows action. */
- private RetargetTextEditorAction fConvertToWindows;
- /** Convert to UNIX action. */
- private RetargetTextEditorAction fConvertToUNIX;
- /** Convert to MAC action. */
- private RetargetTextEditorAction fConvertToMac;
- /** Encoding action group */
- private EncodingActionGroup fEncodingActionGroup;
-
-
- /**
- * Creates a new contributor.
- */
- public TextEditorActionContributor() {
- super();
-
- // line delimiter conversion
- fConvertToWindows= new RetargetTextEditorAction(TextEditorMessages.getResourceBundle(), "Editor.ConvertToWindows."); //$NON-NLS-1$
- fConvertToUNIX= new RetargetTextEditorAction(TextEditorMessages.getResourceBundle(), "Editor.ConvertToUNIX."); //$NON-NLS-1$
- fConvertToMac= new RetargetTextEditorAction(TextEditorMessages.getResourceBundle(), "Editor.ConvertToMac."); //$NON-NLS-1$
-
- // character encoding
- fEncodingActionGroup= new EncodingActionGroup();
- }
-
- /**
- * Internally sets the active editor to the actions provided by this contributor.
- * Cannot be overridden by subclasses.
- *
- * @param part the editor
- */
- private void doSetActiveEditor(IEditorPart part) {
-
- ITextEditor textEditor= null;
- if (part instanceof ITextEditor)
- textEditor= (ITextEditor) part;
-
- IActionBars actionBars= getActionBars();
- if (actionBars != null) {
- actionBars.setGlobalActionHandler(IDEActionFactory.ADD_TASK.getId(), getAction(textEditor, IDEActionFactory.ADD_TASK.getId()));
- actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(textEditor, IDEActionFactory.BOOKMARK.getId()));
- }
-
- // line delimiter conversion
- fConvertToWindows.setAction(getAction(textEditor, ITextEditorActionConstants.CONVERT_LINE_DELIMITERS_TO_WINDOWS));
- fConvertToUNIX.setAction(getAction(textEditor, ITextEditorActionConstants.CONVERT_LINE_DELIMITERS_TO_UNIX));
- fConvertToMac.setAction(getAction(textEditor, ITextEditorActionConstants.CONVERT_LINE_DELIMITERS_TO_MAC));
-
- // character encoding
- fEncodingActionGroup.retarget(textEditor);
- }
-
- /*
- * @see IEditorActionBarContributor#setActiveEditor(org.eclipse.ui.IEditorPart)
- */
- public void setActiveEditor(IEditorPart part) {
- super.setActiveEditor(part);
- doSetActiveEditor(part);
- }
-
- /*
- * @see EditorActionBarContributor#init(org.eclipse.ui.IActionBars)
- */
- public void init(IActionBars bars) {
- super.init(bars);
-
- // line delimiter conversion
- IMenuManager menuManager= bars.getMenuManager();
- IMenuManager editMenu= menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- if (editMenu != null) {
- MenuManager subMenu= new MenuManager(TextEditorMessages.getString("Editor.ConvertLineDelimiters.label")); //$NON-NLS-1$
-
- subMenu.add(fConvertToWindows);
- subMenu.add(fConvertToUNIX);
- subMenu.add(fConvertToMac);
-
- editMenu.add(subMenu);
- }
-
- // character encoding
- fEncodingActionGroup.fillActionBars(bars);
- }
-
- /*
- * @see IEditorActionBarContributor#dispose()
- */
- public void dispose() {
- doSetActiveEditor(null);
- super.dispose();
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java
deleted file mode 100644
index cd4644891..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.java
+++ /dev/null
@@ -1,71 +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.ui.editors.text;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Helper class to get NLSed messages.
- */
-class TextEditorMessages {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.editors.text.TextEditorMessages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private TextEditorMessages() {
- }
-
- /**
- * 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 argument.
- *
- * @param key the string used to get the bundle value, must not be null
- * @param arg the argument used to format the string
- * @return the formatted string
- * @since 3.0
- */
- 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 });
- }
-
- /**
- * Returns a resource bundle.
- *
- * @return the resource bundle
- */
- public static ResourceBundle getResourceBundle() {
- return fgResourceBundle;
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.properties b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.properties
deleted file mode 100644
index f712fb987..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorMessages.properties
+++ /dev/null
@@ -1,129 +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
-###############################################################################
-
-PreferencePage.description=Default Text Editor Settings
-PreferencePage.fontEditor=Text Font:
-
-FileDocumentProvider.createElementInfo=FileDocumentProvider.createElementInfo
-FileDocumentProvider.error.out_of_sync=Has been changed on the file system
-FileDocumentProvider.task.saving=Saving
-FileDocumentProvider.updateContent=FileDocumentProvider.updateContent
-FileDocumentProvider.resetDocument=FileDocumentProvider.resetDocument
-FileDocumentProvider.getPersistedEncoding=Cannot migrate encoding property
-
-StorageDocumentProvider.updateCache=StorageDocumentProvider.updateCache
-StorageDocumentProvider.isReadOnly=StorageDocumentProvider.isReadOnly
-StorageDocumentProvider.isModifiable=StorageDocumentProvider.isModifiable
-
-TextFileDocumentProvider.beginTask.saving= Saving
-
-Editor.error.save.message=Save could not be completed. {0}
-Editor.error.save.title=Problems During Save As...
-Editor.warning.save.delete=The original file ''{0}'' has been deleted.
-
-Editor.AddMenu.label=&Add
-
-Editor.ConvertLineDelimiters.label=C&onvert Line Delimiters To
-
-Editor.ConvertToWindows.label=&Windows
-Editor.ConvertToWindows.tooltip=Converts Line Delimiters to Windows
-Editor.ConvertToWindows.image=
-Editor.ConvertToWindows.description=Converts line delimiters to Windows
-
-Editor.ConvertToUNIX.label=&UNIX
-Editor.ConvertToUNIX.tooltip=Converts Line Delimiters to UNIX
-Editor.ConvertToUNIX.image=
-Editor.ConvertToUNIX.description=Converts line delimiters to UNIX
-
-Editor.ConvertToMac.label=&Mac
-Editor.ConvertToMac.tooltip=Converts line delimiters to Mac
-Editor.ConvertToMac.image=
-Editor.ConvertToMac.description=Converts line delimiters to Mac
-
-
-Editor.error.unreadable_encoding.header=Character Encoding Problems
-Editor.error.unreadable_encoding.banner=
-Editor.error.unreadable_encoding.message_arg=This file is unreadable using the \"{0}\" character encoding.
-Editor.error.unreadable_encoding.message=This file is unreadable using the current character encoding.
-
-Editor.error.unsupported_encoding.header=Unsupported Character Encoding
-Editor.error.unsupported_encoding.banner=
-Editor.error.unsupported_encoding.message_arg=Character encoding \"{0}\" is not supported by this platform.
-Editor.error.unsupported_encoding.message= The current character encoding is not supported by this platform.
-
-Editor.ConvertEncoding.submenu.label=Enc&oding
-
-Editor.ConvertEncoding.default_suffix=(default)
-
-Editor.ConvertEncoding.default.label= Default
-Editor.ConvertEncoding.default.tooltip=Use the Default Character Encoding
-Editor.ConvertEncoding.default.image=
-Editor.ConvertEncoding.default.description=Use the default character encoding
-
-Editor.ConvertEncoding.System.label=Platform encoding
-Editor.ConvertEncoding.System.tooltip=Use the Platform Character Encoding
-Editor.ConvertEncoding.System.image=
-Editor.ConvertEncoding.System.description=Use the platform character encoding
-
-Editor.ConvertEncoding.US-ASCII.label=ASCII
-Editor.ConvertEncoding.US-ASCII.tooltip=Use US-ASCII Character Encoding
-Editor.ConvertEncoding.US-ASCII.image=
-Editor.ConvertEncoding.US-ASCII.description=Use US-ASCII character encoding
-
-Editor.ConvertEncoding.ISO-8859-1.label=Latin 1
-Editor.ConvertEncoding.ISO-8859-1.tooltip=Use ISO-8859-1 Character Encoding
-Editor.ConvertEncoding.ISO-8859-1.image=
-Editor.ConvertEncoding.ISO-8859-1.description=Use ISO-8859-1 character encoding
-
-Editor.ConvertEncoding.UTF-8.label=UTF-8
-Editor.ConvertEncoding.UTF-8.tooltip=Use UTF-8 Character Encoding
-Editor.ConvertEncoding.UTF-8.image=
-Editor.ConvertEncoding.UTF-8.description=Use UTF-8 character encoding
-
-Editor.ConvertEncoding.UTF-16BE.label=UTF-16 (big-endian)
-Editor.ConvertEncoding.UTF-16BE.tooltip=Use UTF-16BE Character Encoding
-Editor.ConvertEncoding.UTF-16BE.image=
-Editor.ConvertEncoding.UTF-16BE.description=Use UTF-16BE character encoding
-
-Editor.ConvertEncoding.UTF-16LE.label=UTF-16 (little-endian)
-Editor.ConvertEncoding.UTF-16LE.tooltip=Use UTF-16LE Character Encoding
-Editor.ConvertEncoding.UTF-16LE.image=
-Editor.ConvertEncoding.UTF-16LE.description=Use UTF-16LE character encoding
-
-Editor.ConvertEncoding.UTF-16.label=UTF-16
-Editor.ConvertEncoding.UTF-16.tooltip=Use UTF-16 Character Encoding
-Editor.ConvertEncoding.UTF-16.image=
-Editor.ConvertEncoding.UTF-16.description=Use UTF-16 character encoding
-
-Editor.ConvertEncoding.Custom.label=&Others...
-Editor.ConvertEncoding.Custom.tooltip=Use a Custom Character Encoding
-Editor.ConvertEncoding.Custom.image=
-Editor.ConvertEncoding.Custom.description=Use a custom character encoding
-Editor.ConvertEncoding.Custom.dialog.title=Character Encoding
-Editor.ConvertEncoding.Custom.dialog.message=Enter the name of the character encoding:
-
-Editor.AddTask.label=&Task...
-Editor.AddTask.tooltip=Add Task
-Editor.AddTask.image=
-Editor.AddTask.description=Add Task
-Editor.AddTask.dialog.title=Add Task
-Editor.AddTask.dialog.message=Enter Task description
-Editor.AddTask.error.dialog.title=Add Task
-Editor.AddTask.error.dialog.message=Problems adding new task
-
-NullProvider.error= ERROR
-
-# Copied from org.eclipse.ui.ide/org/eclipse/ui/internal/ide/messages.properties
-ResourceInfo.fileContentEncodingFormat= Default (determined from content: {0})
-ResourceInfo.fileContainerEncodingFormat= Default (inherited from container: {0})
-WorkbenchPreference.encoding.BOM_UTF_8= UTF-8 (BOM)
-WorkbenchPreference.encoding.BOM_UTF_16BE= UTF-16 Big-Endian (BOM)
-WorkbenchPreference.encoding.BOM_UTF_16LE= UTF-16 Little-Endian (BOM)
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferenceConstants.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferenceConstants.java
deleted file mode 100644
index 2aa451386..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferenceConstants.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.ui.editors.text;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-
-
-/**
- * Preference constants used in the default text editor preference store.
- * @since 2.1
- */
-public class TextEditorPreferenceConstants {
-
- /**
- * Prevent initialization.
- */
- private TextEditorPreferenceConstants() {
- }
-
- /**
- * A named preference that controls whether the current line highlighting is turned on or off
- * (value <code>"currentLine"</code>).
- * <p>
- * The preference value is of type <code>Boolean</code>.
- * </p>
- * @deprecated As of 3.0,, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_CURRENT_LINE= "currentLine"; //$NON-NLS-1$
-
- /**
- * A named preference that holds the color used to highlight the current line
- * (value <code>"currentLineColor"</code>).
- * <p>
- * The preference value is of type <code>String</code>. A RGB color value encoded as a string
- * using class <code>PreferenceConverter</code>.
- * </p>
- * @see org.eclipse.jface.resource.StringConverter
- * @see org.eclipse.jface.preference.PreferenceConverter
- * @deprecated As of 3.0, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_CURRENT_LINE_COLOR= "currentLineColor"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether the print margin is turned on or off
- * (value <code>"printMargin"</code>).
- * <p>
- * The preference value is of type <code>Boolean</code>.
- * </p>
- * @deprecated As of 3.0,, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_PRINT_MARGIN= "printMargin"; //$NON-NLS-1$
-
- /**
- * A named preference that holds the color used to render the print margin
- * (value <code>"printMarginColor"</code>).
- * <p>
- * The preference value is of type <code>String</code>. A RGB color value encoded as a string
- * using class <code>PreferenceConverter</code>.
- * </p>
- * @see org.eclipse.jface.resource.StringConverter
- * @see org.eclipse.jface.preference.PreferenceConverter
- * @deprecated As of 3.0,, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_PRINT_MARGIN_COLOR= "printMarginColor"; //$NON-NLS-1$
-
- /**
- * Print margin column
- * (value <code>"printMarginColumn"</code>).
- * <p>
- * The preference value is of type <code>int</code>.
- * </p>
- * @deprecated As of 3.0,, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_PRINT_MARGIN_COLUMN= "printMarginColumn"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether the editor shows unknown
- * indicators in text (squiggly lines).
- * (value <code>"othersIndication"</code>).
- * <p>
- * The preference value is of type <code>Boolean</code>.
- * </p>
- * @since 2.1
- * @deprecated As of 3.0, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_UNKNOWN_INDICATION= "othersIndication"; //$NON-NLS-1$
-
- /**
- * A named preference that holds the color used to render unknown indicators
- * (value <code>"othersIndicationColor"</code>).
- * <p>
- * The preference value is of type <code>String</code>. A RGB color value encoded as a string
- * using class <code>PreferenceConverter</code>.
- * </p>
- * @see #EDITOR_UNKNOWN_INDICATION
- * @see org.eclipse.jface.resource.StringConverter
- * @see org.eclipse.jface.preference.PreferenceConverter
- * @since 2.1
- * @deprecated As of 3.0, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_UNKNOWN_INDICATION_COLOR= "othersIndicationColor"; //$NON-NLS-1$
-
- /**
- * A named preference that controls whether the overview ruler shows unknown indicators
- * (value <code>"othersIndicationInOverviewRuler"</code>).
- * <p>
- * The preference value is of type <code>Boolean</code>.
- * </p>
- * @since 2.1
- * @deprecated As of 3.0, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_UNKNOWN_INDICATION_IN_OVERVIEW_RULER= "othersIndicationInOverviewRuler"; //$NON-NLS-1$
-
- /**
- * A named preference that controls if the overview ruler is shown in the UI
- * (value <code>"overviewRuler"</code>).
- * <p>
- * The preference value is of type <code>Boolean</code>.
- * </p>
- * @deprecated As of 3.0, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_OVERVIEW_RULER= "overviewRuler"; //$NON-NLS-1$
-
- /**
- * A named preference that controls if the line number ruler is shown in the UI
- * (value <code>"lineNumberRuler"</code>).
- * <p>
- * The preference value is of type <code>Boolean</code>.
- * </p>
- * @deprecated As of 3.0, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_LINE_NUMBER_RULER= "lineNumberRuler"; //$NON-NLS-1$
-
- /**
- * A named preference that holds the color used to render line numbers inside the line number ruler
- * (value <code>"lineNumberColor"</code>).
- * <p>
- * The preference value is of type <code>String</code>. A RGB color value encoded as a string
- * using class <code>PreferenceConverter</code>.
- * </p>
- * @see org.eclipse.jface.resource.StringConverter
- * @see org.eclipse.jface.preference.PreferenceConverter
- * @see #EDITOR_LINE_NUMBER_RULER
- * @deprecated As of 3.0, replaced by {@link org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants}
- */
- public final static String EDITOR_LINE_NUMBER_RULER_COLOR= "lineNumberColor"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_PROBLEM_INDICATION= "problemIndication"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_PROBLEM_INDICATION_COLOR= "problemIndicationColor"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_WARNING_INDICATION= "warningIndication"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_WARNING_INDICATION_COLOR= "warningIndicationColor"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_INFO_INDICATION= "infoIndication"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_INFO_INDICATION_COLOR= "infoIndicationColor"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_TASK_INDICATION= "taskIndication"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_TASK_INDICATION_COLOR= "taskIndicationColor"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_BOOKMARK_INDICATION= "bookmarkIndication"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_BOOKMARK_INDICATION_COLOR= "bookmarkIndicationColor"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_SEARCH_RESULT_INDICATION= "searchResultIndication"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_SEARCH_RESULT_INDICATION_COLOR= "searchResultIndicationColor"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_ERROR_INDICATION_IN_OVERVIEW_RULER= "errorIndicationInOverviewRuler"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_WARNING_INDICATION_IN_OVERVIEW_RULER= "warningIndicationInOverviewRuler"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_INFO_INDICATION_IN_OVERVIEW_RULER= "infoIndicationInOverviewRuler"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_TASK_INDICATION_IN_OVERVIEW_RULER= "taskIndicationInOverviewRuler"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_BOOKMARK_INDICATION_IN_OVERVIEW_RULER= "bookmarkIndicationInOverviewRuler"; //$NON-NLS-1$
-
- /**
- * @deprecated As of 2.1, provided by <code>org.eclipse.ui.editors.markerAnnotationSpecification</code> extension point
- */
- public final static String EDITOR_SEARCH_RESULT_INDICATION_IN_OVERVIEW_RULER= "searchResultIndicationInOverviewRuler"; //$NON-NLS-1$
-
- /**
- * Initializes the given preference store with the default values.
- *
- * @param store the preference store to be initialized
- */
- public static void initializeDefaultValues(IPreferenceStore store) {
-
- // set defaults from AbstractDecoratedTextEditor
- AbstractDecoratedTextEditorPreferenceConstants.initializeDefaultValues(store);
-
- store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_CUSTOM_CARETS, true);
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferencePage.java
deleted file mode 100644
index fd0dd1821..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditorPreferencePage.java
+++ /dev/null
@@ -1,119 +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.ui.editors.text;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.FontFieldEditor;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.resource.JFaceResources;
-
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
-
-
-/**
- * A preference page to set the font used in the default text editor.
- * <p>
- * This preference page uses the text editor's preference bundle and
- * uses the key <code>"PreferencePage.description"</code> to look up
- * the page description. In addition, it uses <code>"PreferencePage.fontEditor"</code>
- * for the editor description.
- * </p>
- * @deprecated As of 2.1, fonts are managed by the workbench, no longer supported
- */
-public class TextEditorPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
- /**
- * Indicates whether the preferences that this page manipulates have been initialized.
- *
- * @since 2.0
- */
- private static boolean fgInitialized= false;
-
- /**
- * Creates and returns the text editor preference page.
- */
- public TextEditorPreferencePage() {
- super(GRID);
-
- setDescription(TextEditorMessages.getString("PreferencePage.description")); //$NON-NLS-1$
- Plugin plugin= Platform.getPlugin("org.eclipse.ui.workbench"); //$NON-NLS-1$
- if (plugin instanceof AbstractUIPlugin) {
- AbstractUIPlugin uiPlugin= (AbstractUIPlugin) plugin;
- setPreferenceStore(uiPlugin.getPreferenceStore());
- }
- }
-
- /*
- * @see IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- WorkbenchHelp.setHelp(getControl(), ITextEditorHelpContextIds.TEXT_EDITOR_PREFERENCE_PAGE);
- }
-
- /*
- * @see FieldEditorPreferencePage#createFieldEditors()
- */
- public void createFieldEditors() {
- addField(new FontFieldEditor(JFaceResources.TEXT_FONT, TextEditorMessages.getString("PreferencePage.fontEditor"), getFieldEditorParent())); //$NON-NLS-1$
- }
-
- /*
- * @see IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- public void init(IWorkbench workbench) {
- }
-
- /**
- * Initializes the defaults for the given store.
- *
- * @param store the preference store
- * @since 2.0
- */
- public static void initDefaults(IPreferenceStore store) {
-
- if (fgInitialized)
- return;
-
- fgInitialized= true;
-
- Font font= JFaceResources.getTextFont();
- if (font != null) {
- FontData[] data= font.getFontData();
- if (data != null && data.length > 0)
- PreferenceConverter.setDefault(store, JFaceResources.TEXT_FONT, data[0]);
- }
-
- Display display= Display.getDefault();
- Color color= display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- PreferenceConverter.setDefault(store, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, color.getRGB());
- store.setDefault(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, true);
-
- color= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
- PreferenceConverter.setDefault(store, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, color.getRGB());
- store.setDefault(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, true);
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java
deleted file mode 100644
index 75afd913a..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextFileDocumentProvider.java
+++ /dev/null
@@ -1,1119 +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.ui.editors.text;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.lang.reflect.InvocationTargetException;
-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.NoSuchElementException;
-
-import org.osgi.framework.Bundle;
-
-import org.eclipse.core.internal.filebuffers.ContainerGenerator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceRuleFactory;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-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.NullProgressMonitor;
-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.runtime.jobs.ISchedulingRule;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.IFileBuffer;
-import org.eclipse.core.filebuffers.IFileBufferListener;
-import org.eclipse.core.filebuffers.IFileBufferManager;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.source.IAnnotationModel;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.editors.text.UISynchronizationContext;
-import org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner;
-import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension2;
-import org.eclipse.ui.texteditor.IDocumentProviderExtension3;
-import org.eclipse.ui.texteditor.IElementStateListener;
-import org.eclipse.ui.texteditor.IElementStateListenerExtension;
-import org.eclipse.ui.texteditor.ISchedulingRuleProvider;
-
-/**
- * @since 3.0
- */
-public class TextFileDocumentProvider implements IDocumentProvider, IDocumentProviderExtension, IDocumentProviderExtension2, IDocumentProviderExtension3, IStorageDocumentProvider {
-
- /**
- * Operation created by the document provider and to be executed by the providers runnable context.
- */
- protected static abstract class DocumentProviderOperation implements IRunnableWithProgress, ISchedulingRuleProvider {
-
- /**
- * The actual functionality of this operation.
- *
- * @param monitor the progress monitor
- * @throws CoreException
- */
- protected abstract void execute(IProgressMonitor monitor) throws CoreException;
-
- /*
- * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- execute(monitor);
- } catch (CoreException x) {
- throw new InvocationTargetException(x);
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.ISchedulingRuleProvider#getSchedulingRule()
- */
- public ISchedulingRule getSchedulingRule() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
- }
-
- static protected class NullProvider implements IDocumentProvider, IDocumentProviderExtension, IDocumentProviderExtension2, IDocumentProviderExtension3, IStorageDocumentProvider {
-
- static final private IStatus STATUS_ERROR= new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.INFO, TextEditorMessages.getString("NullProvider.error"), null); //$NON-NLS-1$
-
- public void connect(Object element) throws CoreException {}
- public void disconnect(Object element) {}
- public IDocument getDocument(Object element) { return null; }
- public void resetDocument(Object element) throws CoreException {}
- public void saveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {}
- public long getModificationStamp(Object element) { return 0; }
- public long getSynchronizationStamp(Object element) { return 0; }
- public boolean isDeleted(Object element) { return true; }
- public boolean mustSaveDocument(Object element) { return false; }
- public boolean canSaveDocument(Object element) { return false; }
- public IAnnotationModel getAnnotationModel(Object element) { return null; }
- public void aboutToChange(Object element) {}
- public void changed(Object element) {}
- public void addElementStateListener(IElementStateListener listener) {}
- public void removeElementStateListener(IElementStateListener listener) {}
- public boolean isReadOnly(Object element) { return true; }
- public boolean isModifiable(Object element) { return false; }
- public void validateState(Object element, Object computationContext) throws CoreException {}
- public boolean isStateValidated(Object element) { return true; }
- public void updateStateCache(Object element) throws CoreException {}
- public void setCanSaveDocument(Object element) {}
- public IStatus getStatus(Object element) { return STATUS_ERROR; }
- public void synchronize(Object element) throws CoreException {}
- public void setProgressMonitor(IProgressMonitor progressMonitor) {}
- public IProgressMonitor getProgressMonitor() { return new NullProgressMonitor(); }
- public boolean isSynchronized(Object element) { return true; }
- public String getDefaultEncoding() { return null; }
- public String getEncoding(Object element) { return null; }
- public void setEncoding(Object element, String encoding) {}
- }
-
- static protected class FileInfo {
- public Object fElement;
- public int fCount;
- public ITextFileBuffer fTextFileBuffer;
- public IAnnotationModel fModel;
- public boolean fCachedReadOnlyState;
- }
-
- static private class SingleElementIterator implements Iterator {
-
- private Object fElement;
-
- public SingleElementIterator(Object element) {
- fElement= element;
- }
-
- /*
- * @see java.util.Iterator#hasNext()
- */
- public boolean hasNext() {
- return fElement != null;
- }
-
- /*
- * @see java.util.Iterator#next()
- */
- public Object next() {
- if (fElement != null) {
- Object result= fElement;
- fElement= null;
- return result;
- }
- throw new NoSuchElementException();
- }
-
- /*
- * @see java.util.Iterator#remove()
- */
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
-
- protected class FileBufferListener implements IFileBufferListener {
-
- public FileBufferListener() {
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFileListener#bufferContentAboutToBeReplaced(org.eclipse.core.buffer.text.IBufferedFile)
- */
- public void bufferContentAboutToBeReplaced(IFileBuffer file) {
- List list= new ArrayList(fElementStateListeners);
- Iterator e= list.iterator();
- while (e.hasNext()) {
- IElementStateListener l= (IElementStateListener) e.next();
- Iterator i= getElements(file);
- while (i.hasNext())
- l.elementContentAboutToBeReplaced(i.next());
- }
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFileListener#bufferContentReplaced(org.eclipse.core.buffer.text.IBufferedFile)
- */
- public void bufferContentReplaced(IFileBuffer file) {
- List list= new ArrayList(fElementStateListeners);
- Iterator e= list.iterator();
- while (e.hasNext()) {
- IElementStateListener l= (IElementStateListener) e.next();
- Iterator i= getElements(file);
- while (i.hasNext())
- l.elementContentReplaced(i.next());
- }
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFileListener#stateChanging(org.eclipse.core.buffer.text.IBufferedFile)
- */
- public void stateChanging(IFileBuffer file) {
- Iterator i= getElements(file);
- while (i.hasNext())
- fireElementStateChanging(i.next());
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFileListener#dirtyStateChanged(org.eclipse.core.buffer.text.IBufferedFile, boolean)
- */
- public void dirtyStateChanged(IFileBuffer file, boolean isDirty) {
- List list= new ArrayList(fElementStateListeners);
- Iterator e= list.iterator();
- while (e.hasNext()) {
- IElementStateListener l= (IElementStateListener) e.next();
- Iterator i= getElements(file);
- while (i.hasNext())
- l.elementDirtyStateChanged(i.next(), isDirty);
- }
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFileListener#stateValidationChanged(org.eclipse.core.buffer.text.IBufferedFile, boolean)
- */
- public void stateValidationChanged(IFileBuffer file, boolean isStateValidated) {
- List list= new ArrayList(fElementStateListeners);
- Iterator e= list.iterator();
- while (e.hasNext()) {
- Object l= e.next();
- if (l instanceof IElementStateListenerExtension) {
- IElementStateListenerExtension x= (IElementStateListenerExtension) l;
- Iterator i= getElements(file);
- while (i.hasNext())
- x.elementStateValidationChanged(i.next(), isStateValidated);
- }
- }
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFileListener#underlyingFileMoved(org.eclipse.core.buffer.text.IBufferedFile, org.eclipse.core.runtime.IPath)
- */
- public void underlyingFileMoved(IFileBuffer file, IPath newLocation) {
- IWorkspace workspace=ResourcesPlugin.getWorkspace();
- IFile newFile= workspace.getRoot().getFile(newLocation);
- IEditorInput input= newFile == null ? null : new FileEditorInput(newFile);
- List list= new ArrayList(fElementStateListeners);
- Iterator e= list.iterator();
- while (e.hasNext()) {
- IElementStateListener l= (IElementStateListener) e.next();
- Iterator i= getElements(file);
- while (i.hasNext())
- l.elementMoved(i.next(), input);
- }
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFileListener#underlyingFileDeleted(org.eclipse.core.buffer.text.IBufferedFile)
- */
- public void underlyingFileDeleted(IFileBuffer file) {
- List list= new ArrayList(fElementStateListeners);
- Iterator e= list.iterator();
- while (e.hasNext()) {
- IElementStateListener l= (IElementStateListener) e.next();
- Iterator i= getElements(file);
- while (i.hasNext())
- l.elementDeleted(i.next());
- }
- }
-
- /*
- * @see org.eclipse.core.buffer.text.IBufferedFileListener#stateChangeFailed(org.eclipse.core.buffer.text.IBufferedFile)
- */
- public void stateChangeFailed(IFileBuffer file) {
- Iterator i= getElements(file);
- while (i.hasNext())
- fireElementStateChangeFailed(i.next());
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#bufferCreated(org.eclipse.core.filebuffers.IFileBuffer)
- */
- public void bufferCreated(IFileBuffer buffer) {
- // ignore
- }
-
- /*
- * @see org.eclipse.core.filebuffers.IFileBufferListener#bufferDisposed(org.eclipse.core.filebuffers.IFileBuffer)
- */
- public void bufferDisposed(IFileBuffer buffer) {
- // ignore
- }
- }
-
- /** The parent document provider */
- private IDocumentProvider fParentProvider;
- /** Element information of all connected elements */
- private final Map fFileInfoMap= new HashMap();
- /** Map from file buffers to their connected elements */
- private final Map fFileBufferMap= new HashMap();
- /** The list of element state listeners */
- private List fElementStateListeners= new ArrayList();
- /** The file buffer listener */
- private final IFileBufferListener fFileBufferListener= new FileBufferListener();
- /** The progress monitor */
- private IProgressMonitor fProgressMonitor;
- /** The operation runner */
- private WorkspaceOperationRunner fOperationRunner;
- /** The rule factory */
- private IResourceRuleFactory fResourceRuleFactory;
-
-
- public TextFileDocumentProvider() {
- this(null);
- }
-
- public TextFileDocumentProvider(IDocumentProvider parentProvider) {
- IFileBufferManager manager= FileBuffers.getTextFileBufferManager();
- manager.setSynchronizationContext(new UISynchronizationContext());
- if (parentProvider != null)
- setParentDocumentProvider(parentProvider);
-
- fResourceRuleFactory= ResourcesPlugin.getWorkspace().getRuleFactory();
- }
-
- final public void setParentDocumentProvider(IDocumentProvider parentProvider) {
-
- Assert.isTrue(parentProvider instanceof IDocumentProviderExtension);
- Assert.isTrue(parentProvider instanceof IDocumentProviderExtension2);
- Assert.isTrue(parentProvider instanceof IDocumentProviderExtension3);
- Assert.isTrue(parentProvider instanceof IStorageDocumentProvider);
-
- fParentProvider= parentProvider;
- if (fParentProvider == null)
- fParentProvider= new NullProvider();
- }
-
- /**
- * Returns the parent document provider.
- *
- * @return the parent document provider
- */
- final protected IDocumentProvider getParentProvider() {
- if (fParentProvider == null)
- fParentProvider= new StorageDocumentProvider();
- return fParentProvider;
- }
-
- /**
- * Returns the runnable context for this document provider.
- *
- * @param monitor the progress monitor
- * @return the runnable context for this document provider
- */
- protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
- if (fOperationRunner == null)
- fOperationRunner = new WorkspaceOperationRunner();
- fOperationRunner.setProgressMonitor(monitor);
- return fOperationRunner;
- }
-
- /**
- * Executes the given operation in the providers runnable context.
- *
- * @param operation the operation to be executes
- * @param monitor the progress monitor
- * @exception CoreException the operation's core exception
- */
- protected void executeOperation(DocumentProviderOperation operation, IProgressMonitor monitor) throws CoreException {
- try {
- IRunnableContext runner= getOperationRunner(monitor);
- if (runner != null)
- runner.run(false, false, operation);
- else
- operation.run(monitor);
- } catch (InvocationTargetException x) {
- Throwable e= x.getTargetException();
- if (e instanceof CoreException)
- throw (CoreException) e;
- String message= (e.getMessage() != null ? e.getMessage() : ""); //$NON-NLS-1$
- throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.ERROR, message, e));
- } catch (InterruptedException x) {
- String message= (x.getMessage() != null ? x.getMessage() : ""); //$NON-NLS-1$
- throw new CoreException(new Status(IStatus.CANCEL, EditorsUI.PLUGIN_ID, IStatus.OK, message, x));
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#connect(java.lang.Object)
- */
- public void connect(Object element) throws CoreException {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info == null) {
-
- info= createFileInfo(element);
- if (info == null) {
- getParentProvider().connect(element);
- return;
- }
-
- info.fElement= element;
- fFileInfoMap.put(element, info);
- storeFileBufferMapping(element, info);
- }
- ++ info.fCount;
- }
-
- /**
- * Updates the file buffer map with a new relation between the file buffer
- * of the given info and the given element.
- *
- * @param element the element
- * @param info the element info
- */
- private void storeFileBufferMapping(Object element, FileInfo info) {
- Object value= fFileBufferMap.get(info.fTextFileBuffer);
-
- if (value instanceof List) {
- List list= (List) value;
- list.add(element);
- return;
- }
-
- if (value == null) {
- value= element;
- } else {
- List list= new ArrayList(2);
- list.add(value);
- list.add(element);
- value= list;
- }
- fFileBufferMap.put(info.fTextFileBuffer, value);
- }
-
- protected FileInfo createEmptyFileInfo() {
- return new FileInfo();
- }
-
- protected FileInfo createFileInfo(Object element) throws CoreException {
-
- IPath location= null;
- if (element instanceof IAdaptable) {
- IAdaptable adaptable= (IAdaptable) element;
- ILocationProvider provider= (ILocationProvider) adaptable.getAdapter(ILocationProvider.class);
- if (provider != null)
- location= provider.getPath(element);
- }
-
- if (location != null) {
- ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
- manager.connect(location, getProgressMonitor());
- manager.requestSynchronizationContext(location);
- ITextFileBuffer fileBuffer= manager.getTextFileBuffer(location);
-
- FileInfo info= createEmptyFileInfo();
- info.fTextFileBuffer= fileBuffer;
- info.fCachedReadOnlyState= isSystemFileReadOnly(info);
-
- IFile file= FileBuffers.getWorkspaceFileAtLocation(location);
- if (file != null && file.exists())
- info.fModel= createAnnotationModel(file);
- return info;
- }
- return null;
- }
-
- protected IAnnotationModel createAnnotationModel(IFile file) {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#disconnect(java.lang.Object)
- */
- public void disconnect(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
-
- if (info == null) {
- getParentProvider().disconnect(element);
- return;
- }
-
- if (info.fCount == 1) {
-
- fFileInfoMap.remove(element);
- removeFileBufferMapping(element, info);
- disposeFileInfo(element, info);
-
- } else
- -- info.fCount;
- }
-
- /**
- * Removes the relation between the file buffer of the given info and the
- * given element from the file buffer mapping.
- *
- * @param element the element
- * @param info the given element info
- */
- private void removeFileBufferMapping(Object element, FileInfo info) {
- Object value= fFileBufferMap.get(info.fTextFileBuffer);
- if (value == null)
- return;
-
- if (value instanceof List) {
- List list= (List) value;
- list.remove(element);
- if (list.size() == 1)
- fFileBufferMap.put(info.fTextFileBuffer, list.get(0));
- } else if (value == element) {
- fFileBufferMap.remove(info.fTextFileBuffer);
- }
- }
-
- protected void disposeFileInfo(Object element, FileInfo info) {
- IFileBufferManager manager= FileBuffers.getTextFileBufferManager();
- try {
- IPath location= info.fTextFileBuffer.getLocation();
- manager.releaseSynchronizationContext(location);
- manager.disconnect(location, getProgressMonitor());
- } catch (CoreException x) {
- handleCoreException(x, "FileDocumentProvider.disposeElementInfo"); //$NON-NLS-1$
- }
- }
-
- /**
- *Returns an iterator for all the elements that are connected to this file buffer.
- *
- * @param file the file buffer
- * @return an iterator for all elements connected with the given file buffer
- */
- protected Iterator getElements(IFileBuffer file) {
- Object value= fFileBufferMap.get(file);
- if (value instanceof List)
- return new ArrayList((List) value).iterator();
- return new SingleElementIterator(value);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getDocument(java.lang.Object)
- */
- public IDocument getDocument(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return info.fTextFileBuffer.getDocument();
- return getParentProvider().getDocument(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#resetDocument(java.lang.Object)
- */
- public void resetDocument(Object element) throws CoreException {
- final FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null) {
- DocumentProviderOperation operation= new DocumentProviderOperation() {
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void execute(IProgressMonitor monitor) throws CoreException {
- info.fTextFileBuffer.revert(monitor);
-
- if (info.fModel instanceof AbstractMarkerAnnotationModel) {
- AbstractMarkerAnnotationModel markerModel= (AbstractMarkerAnnotationModel) info.fModel;
- markerModel.resetMarkers();
- }
- }
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#getSchedulingRule()
- */
- public ISchedulingRule getSchedulingRule() {
- if (info.fElement instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) info.fElement;
- return fResourceRuleFactory.modifyRule((input).getFile());
- } else
- return null;
- }
- };
- executeOperation(operation, getProgressMonitor());
- } else {
- getParentProvider().resetDocument(element);
- }
- }
-
- /*
- * @see IDocumentProvider#saveDocument(IProgressMonitor, Object, IDocument, boolean)
- */
- public final void saveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
-
- if (element == null)
- return;
-
- DocumentProviderOperation operation= createSaveOperation(element, document, overwrite);
- if (operation != null)
- executeOperation(operation, monitor);
- else
- getParentProvider().saveDocument(monitor, element, document, overwrite);
- }
-
- protected DocumentProviderOperation createSaveOperation(final Object element, final IDocument document, final boolean overwrite) throws CoreException {
- final FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null) {
-
- if (info.fTextFileBuffer.getDocument() != document) {
- Status status= new Status(IStatus.WARNING, EditorsUI.PLUGIN_ID, IStatus.ERROR, "not the same document", null); //$NON-NLS-1$
- throw new CoreException(status);
- }
-
- return new DocumentProviderOperation() {
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- commitFileBuffer(monitor, info, overwrite);
- }
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#getSchedulingRule()
- */
- public ISchedulingRule getSchedulingRule() {
- if (info.fElement instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) info.fElement;
- return computeSchedulingRule(input.getFile());
- } else
- return null;
- }
- };
-
- } else if (element instanceof IFileEditorInput) {
-
- final IFile file= ((IFileEditorInput) element).getFile();
- return new DocumentProviderOperation() {
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void execute(IProgressMonitor monitor) throws CoreException {
- createFileFromDocument(monitor, file, document);
- }
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#getSchedulingRule()
- */
- public ISchedulingRule getSchedulingRule() {
- return computeSchedulingRule(file);
- }
- };
- }
-
- return null;
- }
-
- protected void commitFileBuffer(IProgressMonitor monitor, FileInfo info, boolean overwrite) throws CoreException {
- Assert.isNotNull(info);
- info.fTextFileBuffer.commit(monitor, overwrite);
- if (info.fModel instanceof AbstractMarkerAnnotationModel) {
- AbstractMarkerAnnotationModel model= (AbstractMarkerAnnotationModel) info.fModel;
- model.updateMarkers(info.fTextFileBuffer.getDocument());
- }
- }
-
- protected void createFileFromDocument(IProgressMonitor monitor, IFile file, IDocument document) throws CoreException {
- String encoding= getCharsetForNewFile(file, document);
- try {
- monitor.beginTask(TextEditorMessages.getString("TextFileDocumentProvider.beginTask.saving"), 2000); //$NON-NLS-1$
- InputStream stream= new ByteArrayInputStream(document.get().getBytes(encoding));
- ContainerGenerator generator = new ContainerGenerator(file.getWorkspace(), file.getParent().getFullPath());
- generator.generateContainer(new SubProgressMonitor(monitor, 1000));
- file.create(stream, false, new SubProgressMonitor(monitor, 1000));
- } catch (UnsupportedEncodingException x) {
- String message= TextEditorMessages.getFormattedString("Editor.error.unsupported_encoding.message_arg", encoding); //$NON-NLS-1$
- IStatus s= new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, message, x);
- throw new CoreException(s);
- } finally {
- monitor.done();
- }
- }
-
- private String getCharsetForNewFile(IFile targetFile, IDocument document) {
- // User-defined encoding has first priority
- String encoding;
- try {
- encoding= targetFile.getCharset(false);
- } catch (CoreException ex) {
- encoding= null;
- }
- if (encoding != null)
- return encoding;
-
- // Probe content
- Reader reader= new BufferedReader(new StringReader(document.get()));
- try {
- QualifiedName[] options= new QualifiedName[] { IContentDescription.CHARSET, IContentDescription.BYTE_ORDER_MARK };
- IContentDescription description= Platform.getContentTypeManager().getDescriptionFor(reader, targetFile.getName(), options);
- if (description != null) {
- encoding= description.getCharset();
- if (encoding != null)
- return encoding;
- }
- } catch (IOException ex) {
- // continue with next strategy
- } finally {
- try {
- reader.close();
- } catch (IOException ex) {
- TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, IStatus.OK, "TextFileDocumentProvider.getCharsetForNewFile(...): Could not close reader", ex)); //$NON-NLS-1$
- }
- }
-
- // Use parent chain
- try {
- return targetFile.getParent().getDefaultCharset();
- } catch (CoreException ex) {
- // Use global default
- return ResourcesPlugin.getEncoding();
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getModificationStamp(java.lang.Object)
- */
- public long getModificationStamp(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return info.fTextFileBuffer.getModificationStamp();
- return getParentProvider().getModificationStamp(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getSynchronizationStamp(java.lang.Object)
- */
- public long getSynchronizationStamp(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return 0;
- return getParentProvider().getSynchronizationStamp(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#isDeleted(java.lang.Object)
- */
- public boolean isDeleted(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null) {
- File file= getSystemFile(info);
- return file == null ? true : !file.exists();
- }
- return getParentProvider().isDeleted(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#mustSaveDocument(java.lang.Object)
- */
- public boolean mustSaveDocument(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return (info.fCount == 1) && info.fTextFileBuffer.isDirty();
- return getParentProvider().mustSaveDocument(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#canSaveDocument(java.lang.Object)
- */
- public boolean canSaveDocument(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return info.fTextFileBuffer.isDirty();
- return getParentProvider().canSaveDocument(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#getAnnotationModel(java.lang.Object)
- */
- public IAnnotationModel getAnnotationModel(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null) {
- if (info.fModel != null)
- return info.fModel;
- return info.fTextFileBuffer.getAnnotationModel();
- }
- return getParentProvider().getAnnotationModel(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#aboutToChange(java.lang.Object)
- */
- public void aboutToChange(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info == null)
- getParentProvider().aboutToChange(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#changed(java.lang.Object)
- */
- public void changed(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info == null)
- getParentProvider().changed(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#addElementStateListener(org.eclipse.ui.texteditor.IElementStateListener)
- */
- public void addElementStateListener(IElementStateListener listener) {
- Assert.isNotNull(listener);
- if (!fElementStateListeners.contains(listener)) {
- fElementStateListeners.add(listener);
- if (fElementStateListeners.size() == 1) {
- IFileBufferManager manager= FileBuffers.getTextFileBufferManager();
- manager.addFileBufferListener(fFileBufferListener);
- }
- }
- getParentProvider().addElementStateListener(listener);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProvider#removeElementStateListener(org.eclipse.ui.texteditor.IElementStateListener)
- */
- public void removeElementStateListener(IElementStateListener listener) {
- Assert.isNotNull(listener);
- fElementStateListeners.remove(listener);
- if (fElementStateListeners.size() == 0) {
- IFileBufferManager manager= FileBuffers.getTextFileBufferManager();
- manager.removeFileBufferListener(fFileBufferListener);
- }
- getParentProvider().removeElementStateListener(listener);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isReadOnly(java.lang.Object)
- */
- public boolean isReadOnly(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return info.fCachedReadOnlyState;
- return ((IDocumentProviderExtension) getParentProvider()).isReadOnly(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isModifiable(java.lang.Object)
- */
- public boolean isModifiable(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return info.fTextFileBuffer.isStateValidated() ? !isSystemFileReadOnly(info) : true;
- return ((IDocumentProviderExtension) getParentProvider()).isModifiable(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#validateState(java.lang.Object, java.lang.Object)
- */
- public void validateState(Object element, final Object computationContext) throws CoreException {
- final FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null) {
- DocumentProviderOperation operation= new DocumentProviderOperation() {
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void execute(IProgressMonitor monitor) throws CoreException {
- info.fTextFileBuffer.validateState(monitor, computationContext);
- }
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#getSchedulingRule()
- */
- public ISchedulingRule getSchedulingRule() {
- if (info.fElement instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) info.fElement;
- return fResourceRuleFactory.validateEditRule(new IResource[] { input.getFile() });
- } else
- return null;
- }
- };
- executeOperation(operation, getProgressMonitor());
- } else
- ((IDocumentProviderExtension) getParentProvider()).validateState(element, computationContext);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isStateValidated(java.lang.Object)
- */
- public boolean isStateValidated(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return info.fTextFileBuffer.isStateValidated();
- return ((IDocumentProviderExtension) getParentProvider()).isStateValidated(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#updateStateCache(java.lang.Object)
- */
- public void updateStateCache(Object element) throws CoreException {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null) {
- boolean isReadOnly= isSystemFileReadOnly(info);
- // See http://bugs.eclipse.org/bugs/show_bug.cgi?id=14469 for the dirty bit check
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=50699 for commenting that out
- if (!info.fCachedReadOnlyState && isReadOnly /*&& !info.fTextFileBuffer.isDirty()*/)
- info.fTextFileBuffer.resetStateValidation();
- info.fCachedReadOnlyState= isReadOnly;
- } else {
- ((IDocumentProviderExtension) getParentProvider()).updateStateCache(element);
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#setCanSaveDocument(java.lang.Object)
- */
- public void setCanSaveDocument(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info == null)
- ((IDocumentProviderExtension) getParentProvider()).setCanSaveDocument(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#getStatus(java.lang.Object)
- */
- public IStatus getStatus(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return info.fTextFileBuffer.getStatus();
- return ((IDocumentProviderExtension) getParentProvider()).getStatus(element);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#synchronize(java.lang.Object)
- */
- public void synchronize(Object element) throws CoreException {
- final FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null) {
- DocumentProviderOperation operation= new DocumentProviderOperation() {
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
- */
- protected void execute(IProgressMonitor monitor) throws CoreException {
- info.fTextFileBuffer.revert(monitor);
- }
- /*
- * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#getSchedulingRule()
- */
- public ISchedulingRule getSchedulingRule() {
- if (info.fElement instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) info.fElement;
- return fResourceRuleFactory.refreshRule(input.getFile());
- } else
- return null;
- }
- };
- executeOperation(operation, getProgressMonitor());
- } else {
- ((IDocumentProviderExtension) getParentProvider()).synchronize(element);
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension2#setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void setProgressMonitor(IProgressMonitor progressMonitor) {
- fProgressMonitor= progressMonitor;
- ((IDocumentProviderExtension2) getParentProvider()).setProgressMonitor(progressMonitor);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension2#getProgressMonitor()
- */
- public IProgressMonitor getProgressMonitor() {
- return fProgressMonitor;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IDocumentProviderExtension3#isSynchronized(java.lang.Object)
- */
- public boolean isSynchronized(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return info.fTextFileBuffer.isSynchronized();
- return ((IDocumentProviderExtension3) getParentProvider()).isSynchronized(element);
- }
-
- /*
- * @see org.eclipse.ui.editors.text.IStorageDocumentProvider#getDefaultEncoding()
- */
- public String getDefaultEncoding() {
- return FileBuffers.getTextFileBufferManager().getDefaultEncoding();
- }
-
- /*
- * @see org.eclipse.ui.editors.text.IStorageDocumentProvider#getEncoding(java.lang.Object)
- */
- public String getEncoding(Object element) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- return info.fTextFileBuffer.getEncoding();
- return ((IStorageDocumentProvider) getParentProvider()).getEncoding(element);
- }
-
- /*
- * @see org.eclipse.ui.editors.text.IStorageDocumentProvider#setEncoding(java.lang.Object, java.lang.String)
- */
- public void setEncoding(Object element, String encoding) {
- FileInfo info= (FileInfo) fFileInfoMap.get(element);
- if (info != null)
- info.fTextFileBuffer.setEncoding(encoding);
- else
- ((IStorageDocumentProvider) getParentProvider()).setEncoding(element, encoding);
- }
-
- /**
- * 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, String message) {
- Bundle bundle = Platform.getBundle(PlatformUI.PLUGIN_ID);
- ILog log= Platform.getLog(bundle);
- IStatus status= message != null ? new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, message, exception) : exception.getStatus();
- log.log(status);
- }
-
- protected File getSystemFile(FileInfo info) {
- IPath path= info.fTextFileBuffer.getLocation();
- return FileBuffers.getSystemFileAtLocation(path);
- }
-
- protected boolean isSystemFileReadOnly(FileInfo info) {
- File file= getSystemFile(info);
- return file == null ? true : !file.canWrite();
- }
-
- protected FileInfo getFileInfo(Object element) {
- return (FileInfo) fFileInfoMap.get(element);
- }
-
- protected Iterator getConnectedElementsIterator() {
- return new HashSet(fFileInfoMap.keySet()).iterator();
- }
-
- protected Iterator getFileInfosIterator() {
- return new ArrayList(fFileInfoMap.values()).iterator();
- }
-
- protected void fireElementStateChanging(Object element) {
- List list= new ArrayList(fElementStateListeners);
- Iterator e= list.iterator();
- while (e.hasNext()) {
- Object l= e.next();
- if (l instanceof IElementStateListenerExtension) {
- IElementStateListenerExtension x= (IElementStateListenerExtension) l;
- x.elementStateChanging(element);
- }
- }
- }
-
- protected void fireElementStateChangeFailed(Object element) {
- List list= new ArrayList(fElementStateListeners);
- Iterator e= list.iterator();
- while (e.hasNext()) {
- Object l= e.next();
- if (l instanceof IElementStateListenerExtension) {
- IElementStateListenerExtension x= (IElementStateListenerExtension) l;
- x.elementStateChangeFailed(element);
- }
- }
- }
-
- /**
- * Computes the scheduling rule needed to create or modify a resource. If
- * the resource exists, its modify rule is returned. If it does not, the
- * resource hierarchy is iterated towards the workspace root to find the
- * first parent of <code>toCreateOrModify</code> that exists. Then the
- * 'create' rule for the last non-existing resource is returned.
- * <p>
- * XXX to be made protected after 3.0
- * </p>
- *
- * @param toCreateOrModify the resource to create or modify
- * @return the minimal scheduling rule needed to modify or create a resource
- */
- private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
- if (toCreateOrModify.exists()) {
- return fResourceRuleFactory.modifyRule(toCreateOrModify);
- } else {
- IResource parent= toCreateOrModify;
- do {
- toCreateOrModify= parent;
- parent= toCreateOrModify.getParent();
- } while (parent != null && !parent.exists());
-
- return fResourceRuleFactory.createRule(toCreateOrModify);
- }
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java
deleted file mode 100644
index 4ac3c636d..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java
+++ /dev/null
@@ -1,78 +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.ui.editors.text;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-
-
-/**
- * Source viewer configuration for the text editor.
- *
- * @since 3.0
- */
-public class TextSourceViewerConfiguration extends SourceViewerConfiguration {
-
- /** The preference store used to initialize this configuration. */
- private IPreferenceStore fPreferenceStore;
-
- /**
- * A no-op implementation of <code>IAnnotationHover</code> that will trigger the text editor
- * to set up annotation hover support.
- */
- private static class NullHover implements IAnnotationHover {
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationHover#getHoverInfo(org.eclipse.jface.text.source.ISourceViewer, int)
- */
- public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
- return null;
- }
-
- }
-
- /**
- * Creates a text source viewer configuration.
- */
- public TextSourceViewerConfiguration() {
- }
-
- /**
- * Creates a text source viewer configuration and
- * initializes it with the given preference store.
- *
- * @param preferenceStore the preference store used to initialize this configuration
- */
- public TextSourceViewerConfiguration(IPreferenceStore preferenceStore) {
- fPreferenceStore= preferenceStore;
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer)
- */
- public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
- return new NullHover();
- }
-
- /*
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getTabWidth(org.eclipse.jface.text.source.ISourceViewer)
- */
- public int getTabWidth(ISourceViewer sourceViewer) {
- if (fPreferenceStore == null)
- return super.getTabWidth(sourceViewer);
- return fPreferenceStore.getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH);
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/package.html b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/package.html
deleted file mode 100644
index 688aefd2d..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/package.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Package-level Javadoc</title>
-</head>
-<body>
-Provides a standard text editor and concrete document providers based
-<tt>IFileBuffer</tt> and others directly handling <tt>IFile</tt> and
-<tt>IStorage</tt> as editor input.
-</body>
-</html>
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java
deleted file mode 100644
index 37153c4f6..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionContextTypeRegistry.java
+++ /dev/null
@@ -1,195 +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.ui.editors.text.templates;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.TemplateContextType;
-import org.eclipse.jface.text.templates.TemplateVariableResolver;
-
-import org.eclipse.ui.editors.text.EditorsUI;
-
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-
-
-/**
- * A registry for context types. Editor implementors will usually instantiate a
- * registry and configure the context types available in their editor.
- * <code>ContextType</code>s can be added either directly using
- * {@link #addContextType(TemplateContextType)} or by instantiating and adding a
- * contributed context type using {@link #addContextType(String)}.
- *
- * @since 3.0
- */
-public class ContributionContextTypeRegistry extends ContextTypeRegistry {
-
- /* extension point string literals */
- private static final String TEMPLATES_EXTENSION_POINT= "org.eclipse.ui.editors.templates"; //$NON-NLS-1$
-
- private static final String CONTEXT_TYPE= "contextType"; //$NON-NLS-1$
- private static final String ID= "id"; //$NON-NLS-1$
- private static final String NAME= "name"; //$NON-NLS-1$
- private static final String CLASS= "class"; //$NON-NLS-1$
-
- private static final String RESOLVER= "resolver"; //$NON-NLS-1$
- private static final String CONTEXT_TYPE_ID= "contextTypeId"; //$NON-NLS-1$
- private static final String DESCRIPTION= "description"; //$NON-NLS-1$
- private static final String TYPE= "type"; //$NON-NLS-1$
-
- /**
- * Tries to create a context type given an id. If there is already a context
- * type registered under the given id, nothing happens. Otherwise,
- * contributions to the <code>org.eclipse.ui.editors.templates</code>
- * extension point are searched for the given identifier and the specified
- * context type instantiated if it is found.
- *
- * @param id the id for the context type as specified in XML
- */
- public void addContextType(String id) {
- Assert.isNotNull(id);
- if (getContextType(id) != null)
- return;
-
- TemplateContextType type= createContextType(id);
- if (type != null)
- addContextType(type);
-
- }
-
- /**
- * Tries to create a context type given an id. Contributions to the
- * <code>org.eclipse.ui.editors.templates</code> extension point are
- * searched for the given identifier and the specified context type
- * instantiated if it is found. Any contributed
- * {@link org.eclipse.jface.text.templates.TemplateVariableResolver}s
- * are also instantiated and added to the context type.
- *
- * @param id the id for the context type as specified in XML
- * @return the instantiated and configured context type, or
- * <code>null</code> if it is not found or cannot be instantiated
- */
- public static TemplateContextType createContextType(String id) {
- Assert.isNotNull(id);
-
- IConfigurationElement[] extensions= getTemplateExtensions();
- TemplateContextType type;
- try {
- type= createContextType(extensions, id);
- if (type != null) {
- TemplateVariableResolver[] resolvers= createResolvers(extensions, id);
- for (int i= 0; i < resolvers.length; i++)
- type.addResolver(resolvers[i]);
- }
- } catch (CoreException e) {
- EditorsPlugin.log(e);
- type= null;
- }
-
- return type;
- }
-
- private static TemplateContextType createContextType(IConfigurationElement[] extensions, String contextTypeId) throws CoreException {
- for (int i= 0; i < extensions.length; i++) {
- // TODO create half-order over contributions
- if (extensions[i].getName().equals(CONTEXT_TYPE)) {
- String id= extensions[i].getAttributeAsIs(ID);
- if (contextTypeId.equals(id))
- return createContextType(extensions[i]);
- }
- }
-
- return null;
- }
-
- /**
- * Instantiates the resolvers contributed to the context type with id
- * <code>contextTypeId</code>. If instantiation of one resolver fails,
- * the exception are logged and operation continues.
- *
- * @param extensions the configuration elements to parse
- * @param contextTypeId the id of the context type for which resolvers are
- * instantiated
- * @return the instantiated resolvers
- */
- private static TemplateVariableResolver[] createResolvers(IConfigurationElement[] extensions, String contextTypeId) {
- List resolvers= new ArrayList();
- for (int i= 0; i < extensions.length; i++) {
- if (extensions[i].getName().equals(RESOLVER)) {
- String declaredId= extensions[i].getAttributeAsIs(CONTEXT_TYPE_ID);
- if (contextTypeId.equals(declaredId)) {
- try {
- TemplateVariableResolver resolver= createResolver(extensions[i]);
- if (resolver != null)
- resolvers.add(resolver);
- } catch (CoreException e) {
- EditorsPlugin.log(e);
- }
- }
- }
- }
-
- return (TemplateVariableResolver[]) resolvers.toArray(new TemplateVariableResolver[resolvers.size()]);
-
- }
-
- private static IConfigurationElement[] getTemplateExtensions() {
- return Platform.getExtensionRegistry().getConfigurationElementsFor(TEMPLATES_EXTENSION_POINT);
- }
-
- private static TemplateContextType createContextType(IConfigurationElement element) throws CoreException {
- String id= element.getAttributeAsIs(ID);
- try {
- TemplateContextType contextType= (TemplateContextType) element.createExecutableExtension(CLASS);
- String name= element.getAttribute(NAME);
- if (name == null)
- name= id;
-
- contextType.setId(id);
- contextType.setName(name);
-
- return contextType;
- } catch (ClassCastException e) {
- throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, "extension does not implement " + TemplateContextType.class.getName(), e)); //$NON-NLS-1$
- }
- }
-
- private static TemplateVariableResolver createResolver(IConfigurationElement element) throws CoreException {
- try {
- String type= element.getAttributeAsIs(TYPE);
- if (type != null) {
-
- TemplateVariableResolver resolver= (TemplateVariableResolver) element.createExecutableExtension(CLASS);
- resolver.setType(type);
-
- String desc= element.getAttribute(DESCRIPTION);
- if (desc == null)
- desc= new String();
- resolver.setDescription(desc);
-
- return resolver;
- }
- } catch (ClassCastException e) {
- throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, "extension does not implement " + TemplateVariableResolver.class.getName(), e)); //$NON-NLS-1$
- }
-
- return null;
- }
-}
-
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.java
deleted file mode 100644
index 8782b4946..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.java
+++ /dev/null
@@ -1,42 +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.ui.editors.text.templates;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Helper class to get NLSed messages.
- *
- * @since 3.0
- */
-class ContributionTemplateMessages {
-
- private static final String BUNDLE_NAME= "org.eclipse.ui.editors.text.templates.ContributionTemplateMessages";//$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
-
- private ContributionTemplateMessages() {}
-
- /**
- * 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 RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.properties b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.properties
deleted file mode 100644
index c5b779f5a..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateMessages.properties
+++ /dev/null
@@ -1,14 +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
-###############################################################################
-ContributionTemplateStore.ignore_prefix=Ignoring template
-ContributionTemplateStore.ignore_postfix_no_id= since it has no id.
-ContributionTemplateStore.ignore_postfix_deleted= since it is deleted.
-ContributionTemplateStore.ignore_postfix_validation_failed= since validation failed.
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java
deleted file mode 100644
index c80f22363..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/ContributionTemplateStore.java
+++ /dev/null
@@ -1,230 +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.ui.editors.text.templates;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-
-import org.osgi.framework.Bundle;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.Template;
-import org.eclipse.jface.text.templates.TemplateException;
-import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData;
-import org.eclipse.jface.text.templates.persistence.TemplateReaderWriter;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-
-
-/**
- * Manages templates. Handles reading default templates contributed via XML and
- * user-defined (or overridden) templates stored in the preferences.
- * <p>
- * Clients may instantiate but not subclass this class.
- * </p>
- *
- * @since 3.0
- */
-public class ContributionTemplateStore extends TemplateStore {
- /* extension point string literals */
- private static final String TEMPLATES_EXTENSION_POINT= "org.eclipse.ui.editors.templates"; //$NON-NLS-1$
-
- private static final String ID= "id"; //$NON-NLS-1$
- private static final String NAME= "name"; //$NON-NLS-1$
-
- private static final String CONTEXT_TYPE_ID= "contextTypeId"; //$NON-NLS-1$
- private static final String DESCRIPTION= "description"; //$NON-NLS-1$
-
- private static final String TEMPLATE= "template"; //$NON-NLS-1$
- private static final String PATTERN= "pattern"; //$NON-NLS-1$
-
- private static final String INCLUDE= "include"; //$NON-NLS-1$
- private static final String FILE= "file"; //$NON-NLS-1$
- private static final String TRANSLATIONS= "translations"; //$NON-NLS-1$
-
- /**
- * Creates a new template store.
- *
- * @param store the preference store in which to store custom templates
- * under <code>key</code>
- * @param key the key into <code>store</code> where to store custom
- * templates
- */
- public ContributionTemplateStore(IPreferenceStore store, String key) {
- super(store, key);
- }
-
- /**
- * Creates a new template store with a context type registry. Only templates
- * that specify a context type contained in the registry will be loaded by
- * this store if the registry is not <code>null</code>.
- *
- * @param registry a context type registry, or <code>null</code> if all
- * templates should be loaded
- * @param store the preference store in which to store custom templates
- * under <code>key</code>
- * @param key the key into <code>store</code> where to store custom
- * templates
- */
- public ContributionTemplateStore(ContextTypeRegistry registry, IPreferenceStore store, String key) {
- super(registry, store, key);
- }
-
- /**
- * Loads the templates contributed via the templates extension point.
- *
- * @throws IOException {@inheritDoc}
- */
- protected void loadContributedTemplates() throws IOException {
- IConfigurationElement[] extensions= getTemplateExtensions();
- Collection contributed= readContributedTemplates(extensions);
- for (Iterator it= contributed.iterator(); it.hasNext();) {
- TemplatePersistenceData data= (TemplatePersistenceData) it.next();
- internalAdd(data);
- }
- }
-
- private Collection readContributedTemplates(IConfigurationElement[] extensions) throws IOException {
- Collection templates= new ArrayList();
- for (int i= 0; i < extensions.length; i++) {
- if (extensions[i].getName().equals(TEMPLATE))
- createTemplate(templates, extensions[i]);
- else if (extensions[i].getName().equals(INCLUDE)) {
- readIncludedTemplates(templates, extensions[i]);
- }
- }
-
- return templates;
- }
-
- private void readIncludedTemplates(Collection templates, IConfigurationElement element) throws IOException {
- String file= element.getAttributeAsIs(FILE);
- if (file != null) {
- Bundle plugin = Platform.getBundle(element.getDeclaringExtension().getNamespace());
- URL url= Platform.find(plugin, new Path(file));
- if (url != null) {
- ResourceBundle bundle= null;
- String translations= element.getAttributeAsIs(TRANSLATIONS);
- if (translations != null) {
- URL bundleURL= Platform.find(plugin, new Path(translations));
- if (url != null) {
- bundle= new PropertyResourceBundle(bundleURL.openStream());
- }
- }
-
- InputStream stream= new BufferedInputStream(url.openStream());
- TemplateReaderWriter reader= new TemplateReaderWriter();
- TemplatePersistenceData[] datas= reader.read(stream, bundle);
- for (int i= 0; i < datas.length; i++) {
- TemplatePersistenceData data= datas[i];
- if (data.isCustom()) {
- if (data.getId() == null)
- EditorsPlugin.logErrorMessage(ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_prefix") + data.getTemplate().getName() + " " + ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_postfix_no_id")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- else
- EditorsPlugin.logErrorMessage(ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_prefix") + data.getTemplate().getName() + " " + ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_postfix_deleted")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else if (!validateTemplate(data.getTemplate())) {
- if (contextExists(data.getTemplate().getContextTypeId()))
- EditorsPlugin.logErrorMessage(ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_prefix") + data.getTemplate().getName() + " " + ContributionTemplateMessages.getString("ContributionTemplateStore.ignore_postfix_validation_failed")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- } else {
- templates.add(data);
- }
- }
- }
- }
- }
-
- /**
- * Validates a template against the context type registered in the context
- * type registry. Returns always <code>true</code> if no registry is
- * present.
- *
- * @param template the template to validate
- * @return <code>true</code> if validation is successful or no context
- * type registry is specified, <code>false</code> if validation
- * fails
- */
- private boolean validateTemplate(Template template) {
- String contextTypeId= template.getContextTypeId();
- if (contextExists(contextTypeId)) {
- if (getRegistry() != null)
- try {
- getRegistry().getContextType(contextTypeId).validate(template.getPattern());
- } catch (TemplateException e) {
- return false;
- }
- return true;
- } else
- return false;
- }
-
- /**
- * Returns <code>true</code> if a context type id specifies a valid context type
- * or if no context type registry is present.
- *
- * @param contextTypeId the context type id to look for
- * @return <code>true</code> if the context type specified by the id
- * is present in the context type registry, or if no registry is
- * specified
- */
- private boolean contextExists(String contextTypeId) {
- return contextTypeId != null && (getRegistry() == null || getRegistry().getContextType(contextTypeId) != null);
- }
-
- private static IConfigurationElement[] getTemplateExtensions() {
- return Platform.getExtensionRegistry().getConfigurationElementsFor(TEMPLATES_EXTENSION_POINT);
- }
-
- private void createTemplate(Collection map, IConfigurationElement element) {
- String contextTypeId= element.getAttributeAsIs(CONTEXT_TYPE_ID);
- // log failures since extension point id and name are mandatory
- if (contextExists(contextTypeId)) {
- String id= element.getAttributeAsIs(ID);
- if (isValidTemplateId(id)) {
-
- String name= element.getAttribute(NAME);
- if (name != null) {
-
- String desc= element.getAttribute(DESCRIPTION);
- if (desc == null)
- desc= new String();
-
- String pattern= element.getChildren(PATTERN)[0].getValue();
- if (pattern != null) {
-
- Template template= new Template(name, desc, contextTypeId, pattern);
- TemplatePersistenceData data= new TemplatePersistenceData(template, true, id);
- if (validateTemplate(template))
- map.add(data);
- }
- }
- }
- }
- }
-
- private static boolean isValidTemplateId(String id) {
- return id != null && id.trim().length() != 0; // TODO test validity?
- }
-}
-
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/package.html b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/package.html
deleted file mode 100644
index e70145a0f..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/templates/package.html
+++ /dev/null
@@ -1,113 +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>Templates</title>
- <meta content="Template Infrastructure package description"
- name="description">
-</head>
-<body>
-Application programming interfaces for interaction
-with the Eclipse Java User Interface text support.
-<h2>Templates<br>
-</h2>
-<h3>packages</h3>
-<ul>
- <li style="font-weight: bold;"><big><span
- style="font-family: monospace;">org.eclipse.jface.text.templates</span></big></li>
- <li style="font-weight: bold;"><big><span
- style="font-family: monospace;">org.eclipse.ui.workbench.texteditor.templates</span><br>
- <span style="font-family: monospace;"></span></big></li>
- <li><big><span style="font-family: monospace; font-weight: bold;">org.eclipse.ui.editors.templates</span></big><br>
- <span style="font-family: monospace;"></span></li>
-</ul>
-<h3><code></code></h3>
-Templates are shortcuts for frequently used fragments of text such as
-code patterns or complex text entities. They may contain variables
-which are only resolved at the time when the template is inserted
-within a context. Together with linked mode, inserting a template can
-create a on-the-fly edit mask within a text viewer.<br>
-<br>
-Templates are specified as text, variables are defined using the <span
- style="font-family: monospace;">${variable}</span> notation known from
-Ant, for example. The following snippet shows an example template for
-an instance check in Java:<br>
-<pre>if (${name} instanceof ${type}) {<br>&nbsp;&nbsp;&nbsp; ${type} ${new_name} = (${type})${name};<br>&nbsp;&nbsp;&nbsp; ${cursor}<br>}<br></pre>
-In this template, the variables (<span style="font-family: monospace;">name,
-type, ...</span><span style="font-family: sans-serif;">) are resolved
-when inserted into java source and changing one variable instance will
-also change the other. When leaving linked mode, the caret is placed at
-the </span><span style="font-family: monospace;">cursor</span><span
- style="font-family: sans-serif;"> variable.<br>
-<br>
-Template functionality can be added to a custom text editor by offering
-</span><span style="font-family: monospace;">TemplateProposal</span><span
- style="font-family: sans-serif;">s as content assist choices, which is
-simplified by using a </span><span style="font-family: sans-serif;"><span
- style="font-family: sans-serif;">subclass of </span></span><span
- style="font-family: monospace;">TemplateCompletionProcessor</span><span
- style="font-family: sans-serif;">. User template management can be
-offered by including a </span><span style="font-family: monospace;">TemplatePreferencePage</span><span
- style="font-family: sans-serif;"> which uses a </span><span
- style="font-family: monospace;">TemplateStore</span><span
- style="font-family: sans-serif;"> and <span
- style="font-family: monospace;">ContextTypeRegistry</span> as the
-underlying model to store templates. The <span
- style="font-family: monospace;">org.eclipse.ui.editors.templates</span>
-extension point can be used to allow other plug-ins to contribute
-templates to an editor. This is accomplished by using the <span
- style="font-family: monospace;">ContributionTemplateStore</span> and <span
- style="font-family: monospace;">ContributionContextTypeRegistry</span>
-subclasses of the above types.<br>
-<br>
-Template variables are resolved by a <span
- style="font-family: monospace;">TemplateVariableResolver.</span> <span
- style="font-family: monospace;">GlobalTemplateVariables</span> offers
-some default variables such as date, user, and selection, but advanced
-features such as resolving to language constructs can be performed in
-subclasses.<br>
-</span>
-<h4>Classes</h4>
-<ul>
- <li><span style="font-family: monospace;">Template</span><span
- style="font-family: sans-serif;"> a template consists of name, context
-type identifier, and a pattern.</span></li>
- <li><span style="font-family: sans-serif;"><span
- style="font-family: monospace;">TemplateTranslator</span> and <span
- style="font-family: monospace;">TemplateBuffer</span> are used to
-parse the template grammar and don't need to be used usually.</span></li>
- <li><span style="font-family: sans-serif;">A <span
- style="font-family: monospace;">TemplateProposal </span>can be
-offered in content assist, possibly created by a subclass of <span
- style="font-family: monospace;">TemplateCompletionProcessor.</span></span></li>
- <li><span style="font-family: sans-serif;"><span
- style="font-family: monospace;">TemplateStore</span> and <span
- style="font-family: monospace;">ContextTypeRegistry</span> manage a
-set of templates within a plug-in and offer ways to store them in the
-preferences or externally in XML streams via a <span
- style="font-family: monospace;">TemplateReaderWriter</span>.<br>
- </span></li>
- <li><span style="font-family: sans-serif;"><span
- style="font-family: monospace;">ContributionTemplateStore</span> and <span
- style="font-family: monospace;">ContributionContextTypeRegistry</span>
-add awareness for the </span><span style="font-family: sans-serif;"><span
- style="font-family: sans-serif;"> <span
- style="font-family: monospace;">org.eclipse.ui.editors.templates</span>
-extension point.</span></span></li>
- <li style="font-family: monospace;"><span
- style="font-family: sans-serif;"><span style="font-family: sans-serif;"><span
- style="font-family: monospace;">TemplatePreferencePage</span> allows
-the user to access the templates within a <span
- style="font-family: monospace;">TemplateStore</span>.</span></span></li>
-</ul>
-<ul>
-</ul>
-<h4>Example</h4>
-<pre><span style="font-family: sans-serif;">See the Template Editor Example in the <span
- style="font-weight: bold;">org.eclipse.ui.examples.javaeditor</span> project.<br></span></pre>
-</body>
-</html>
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/LastSaveReferenceProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/LastSaveReferenceProvider.java
deleted file mode 100644
index a00ceac0d..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/LastSaveReferenceProvider.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.ui.internal.editors.quickdiff;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.Job;
-
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.IDocument;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.editors.text.IStorageDocumentProvider;
-import org.eclipse.ui.texteditor.IDocumentProvider;
-import org.eclipse.ui.texteditor.IElementStateListener;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.quickdiff.IQuickDiffReferenceProvider;
-
-/**
- * Default provider for the quickdiff display - the saved document is taken as
- * the reference.
- *
- * @since 3.0
- */
-public class LastSaveReferenceProvider implements IQuickDiffReferenceProvider, IElementStateListener {
-
- /** <code>true</code> if the document has been read. */
- private boolean fDocumentRead= false;
- /**
- * The reference document - might be <code>null</code> even if <code>fDocumentRead</code>
- * is <code>true</code>.
- */
- private IDocument fReference= null;
- /**
- * Our unique id that makes us comparable to another instance of the same
- * provider. See extension point reference.
- */
- private String fId;
- /** The current document provider. */
- private IDocumentProvider fDocumentProvider;
- /** The current editor input. */
- private IEditorInput fEditorInput;
- /** Private lock no one else will synchronize on. */
- private final Object fLock= new Object();
- /**
- * The progress monitor for a currently running <code>getReference</code>
- * operation, or <code>null</code>.
- */
- private IProgressMonitor fProgressMonitor;
- /** The text editor we run upon. */
- private ITextEditor fEditor;
-
- /**
- * A job to put the reading of file contents into a background.
- */
- private final class ReadJob extends Job {
-
- /**
- * Creates a new instance.
- */
- public ReadJob() {
- super(QuickDiffMessages.getString("LastSaveReferenceProvider.LastSaveReferenceProvider.readJob.label")); //$NON-NLS-1$
- setSystem(true);
- setPriority(SHORT);
- }
-
- /**
- * Calls
- * {@link LastSaveReferenceProvider#readDocument(IProgressMonitor, boolean)}
- * and returns {@link Status#OK_STATUS}.
- *
- * {@inheritdoc}
- *
- * @param monitor {@inheritDoc}
- * @return {@link Status#OK_STATUS}
- */
- protected IStatus run(IProgressMonitor monitor) {
- readDocument(monitor, false);
- return Status.OK_STATUS;
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.quickdiff.IQuickDiffReferenceProvider#getReference(org.eclipse.core.runtime.IProgressMonitor)
- */
- public IDocument getReference(IProgressMonitor monitor) {
- if (!fDocumentRead)
- readDocument(monitor, true); // force reading it
- return fReference;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.quickdiff.IQuickDiffReferenceProvider#dispose()
- */
- public void dispose() {
- IProgressMonitor monitor= fProgressMonitor;
- if (monitor != null) {
- monitor.setCanceled(true);
- }
-
- IDocumentProvider provider= fDocumentProvider;
-
- synchronized (fLock) {
- if (provider != null)
- provider.removeElementStateListener(this);
- fEditorInput= null;
- fDocumentProvider= null;
- fReference= null;
- fDocumentRead= false;
- fProgressMonitor= null;
- fEditor= null;
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.quickdiff.IQuickDiffReferenceProvider#getId()
- */
- public String getId() {
- return fId;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.quickdiff.IQuickDiffProviderImplementation#setActiveEditor(org.eclipse.ui.texteditor.ITextEditor)
- */
- public void setActiveEditor(ITextEditor targetEditor) {
- IDocumentProvider provider= null;
- IEditorInput input= null;
- if (targetEditor != null) {
- provider= targetEditor.getDocumentProvider();
- input= targetEditor.getEditorInput();
- }
-
-
- // dispose if the editor input or document provider have changed
- // note that they may serve multiple editors
- if (provider != fDocumentProvider || input != fEditorInput) {
- dispose();
- synchronized (fLock) {
- fEditor= targetEditor;
- fDocumentProvider= provider;
- fEditorInput= input;
- }
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.quickdiff.IQuickDiffProviderImplementation#isEnabled()
- */
- public boolean isEnabled() {
- return fEditorInput != null && fDocumentProvider != null;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.quickdiff.IQuickDiffProviderImplementation#setId(java.lang.String)
- */
- public void setId(String id) {
- fId= id;
- }
-
- /**
- * Reads in the saved document into <code>fReference</code>.
- *
- * @param monitor a progress monitor, or <code>null</code>
- * @param force <code>true</code> if the reference document should also
- * be read if the current document is <code>null</code>,<code>false</code>
- * if it should only be updated if it already existed.
- */
- private void readDocument(IProgressMonitor monitor, boolean force) {
-
- // protect against concurrent disposal
- IDocumentProvider prov= fDocumentProvider;
- IEditorInput inp= fEditorInput;
- IDocument doc= fReference;
- ITextEditor editor= fEditor;
-
- if (prov instanceof IStorageDocumentProvider && inp instanceof IFileEditorInput) {
-
- IFileEditorInput input= (IFileEditorInput) inp;
- IStorageDocumentProvider provider= (IStorageDocumentProvider) prov;
-
- if (doc == null)
- if (force || fDocumentRead)
- doc= new Document();
- else
- return;
-
- IJobManager jobMgr= Platform.getJobManager();
- IFile file= input.getFile();
-
- try {
- fProgressMonitor= monitor;
-
- // this protects others from not being able to delete the file,
- // and protects ourselves from concurrent access to fReference
- // (in the case there already is a valid fReference)
-
- // one might argue that this rule should already be in the Job
- // description we're running in, however:
- // 1) we don't mind waiting for someone else here
- // 2) we do not take long, or require other locks etc. -> short
- // delay for any other job requiring the lock on file
- jobMgr.beginRule(file, monitor);
-
- InputStream stream= getFileContents(file);
- if (stream == null)
- return;
-
- String encoding= file.getCharset();
- if (encoding == null)
- return;
-
- boolean skipUTF8BOM= isUTF8BOM(encoding, file);
-
- setDocumentContent(doc, stream, encoding, monitor, skipUTF8BOM);
-
- } catch (IOException e) {
- return;
- } catch (CoreException e) {
- return;
- } finally {
- jobMgr.endRule(file);
- fProgressMonitor= null;
- }
-
- if (monitor != null && monitor.isCanceled())
- return;
-
- // update state
- synchronized (fLock) {
- if (fDocumentProvider == provider && fEditorInput == input) {
- // only update state if our provider / input pair has not
- // been updated in between (dispose or setActiveEditor)
- fReference= doc;
- fDocumentRead= true;
- addElementStateListener(editor, prov);
- }
- }
- }
- }
-
- /* utility methods */
-
- /**
- * Adds this as element state listener in the UI thread as it can otherwise
- * conflict with other listener additions, since DocumentProvider is not
- * thread-safe.
- *
- * @param editor the editor to get the display from
- * @param provider the document provider to register as element state listener
- */
- private void addElementStateListener(ITextEditor editor, final IDocumentProvider provider) {
- // addElementStateListener adds at most once - no problem to call
- provider.addElementStateListener(this);
-
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=66686 and
- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=56871
-
-// // repeatedly
-// Runnable runnable= new Runnable() {
-// public void run() {
-// synchronized (fLock) {
-// if (fDocumentProvider == provider)
-// provider.addElementStateListener(LastSaveReferenceProvider.this);
-// }
-// }
-// };
-//
-// Display display= null;
-// if (editor != null) {
-// IWorkbenchPartSite site= editor.getSite();
-// if (site != null)
-// site.getWorkbenchWindow().getShell().getDisplay();
-// }
-//
-// if (display != null && !display.isDisposed())
-// display.asyncExec(runnable);
-// else
-// runnable.run();
- }
-
- /**
- * Gets the contents of <code>file</code> as an input stream.
- *
- * @param file the <code>IFile</code> which we want the content for
- * @return an input stream for the file's content
- */
- private static InputStream getFileContents(IFile file) {
- InputStream stream= null;
- try {
- if (file != null)
- stream= file.getContents();
- } catch (CoreException e) {
- // ignore
- }
- return stream;
- }
-
- /**
- * Initializes 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
- * @param monitor a progress monitor for cancellation, or <code>null</code>
- * @param skipUTF8BOM whether to skip three bytes before reading the stream
- * @exception IOException if the given stream can not be read
- */
- private static void setDocumentContent(IDocument document, InputStream contentStream, String encoding, IProgressMonitor monitor, boolean skipUTF8BOM) throws IOException {
- Reader in= null;
- try {
-
- if (skipUTF8BOM) {
- for (int i= 0; i < 3; i++)
- if (contentStream.read() == -1) {
- throw new IOException(QuickDiffMessages.getString("LastSaveReferenceProvider.LastSaveReferenceProvider.error.notEnoughBytesForBOM")); //$NON-NLS-1$
- }
- }
-
- final int DEFAULT_FILE_SIZE= 15 * 1024;
-
- in= new BufferedReader(new InputStreamReader(contentStream, encoding), DEFAULT_FILE_SIZE);
- StringBuffer buffer= new StringBuffer(DEFAULT_FILE_SIZE);
- char[] readBuffer= new char[2048];
- int n= in.read(readBuffer);
- while (n > 0) {
- if (monitor != null && monitor.isCanceled())
- return;
-
- buffer.append(readBuffer, 0, n);
- n= in.read(readBuffer);
- }
-
- document.set(buffer.toString());
-
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException x) {
- // ignore
- }
- }
- }
- }
-
- /**
- * Returns <code>true</code> if the <code>encoding</code> is UTF-8 and
- * the file contains a BOM. Taken from ResourceTextFileBuffer.java.
- *
- * <p>
- * 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>
- * @throws CoreException if
- * - reading of file's content description fails
- * - byte order mark is not valid for UTF-8
- */
- private static boolean isUTF8BOM(String encoding, IFile file) throws CoreException {
- if ("UTF-8".equals(encoding)) { //$NON-NLS-1$
- IContentDescription description= file.getContentDescription();
- if (description != null) {
- byte[] bom= (byte[]) description.getProperty(IContentDescription.BYTE_ORDER_MARK);
- if (bom != null) {
- if (bom != IContentDescription.BOM_UTF_8)
- throw new CoreException(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IStatus.OK, QuickDiffMessages.getString("LastSaveReferenceProvider.LastSaveReferenceProvider.error.wrongByteOrderMark"), null)); //$NON-NLS-1$
- return true;
- }
- }
- }
- return false;
- }
-
- /* IElementStateListener implementation */
-
- /*
- * @see org.eclipse.ui.texteditor.IElementStateListener#elementDirtyStateChanged(java.lang.Object, boolean)
- */
- public void elementDirtyStateChanged(Object element, boolean isDirty) {
- if (!isDirty && element == fEditorInput) {
- // document has been saved or reverted - recreate reference
- new ReadJob().schedule();
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IElementStateListener#elementContentAboutToBeReplaced(java.lang.Object)
- */
- public void elementContentAboutToBeReplaced(Object element) {
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IElementStateListener#elementContentReplaced(java.lang.Object)
- */
- public void elementContentReplaced(Object element) {
- if (element == fEditorInput) {
- // document has been reverted or replaced
- new ReadJob().schedule();
- }
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IElementStateListener#elementDeleted(java.lang.Object)
- */
- public void elementDeleted(Object element) {
- }
-
- /*
- * @see org.eclipse.ui.texteditor.IElementStateListener#elementMoved(java.lang.Object, java.lang.Object)
- */
- public void elementMoved(Object originalElement, Object movedElement) {
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffMessages.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffMessages.java
deleted file mode 100644
index 6fafa97e6..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffMessages.java
+++ /dev/null
@@ -1,44 +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.ui.internal.editors.quickdiff;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @since 3.0
- */
-public class QuickDiffMessages {
- private static final String BUNDLE_NAME= "org.eclipse.ui.internal.editors.quickdiff.QuickDiffMessages";//$NON-NLS-1$
-
- private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
-
- /**
- *
- */
- private QuickDiffMessages() {
-
- // TODO Auto-generated constructor stub
- }
-
- /**
- * @param key
- * @return
- */
- public static String getString(String key) {
- // TODO Auto-generated method stub
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffMessages.properties b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffMessages.properties
deleted file mode 100644
index 1c29d4c49..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/quickdiff/QuickDiffMessages.properties
+++ /dev/null
@@ -1,14 +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
-###############################################################################
-
-LastSaveReferenceProvider.LastSaveReferenceProvider.readJob.label=Reading saved version of file for quick diff
-LastSaveReferenceProvider.LastSaveReferenceProvider.error.notEnoughBytesForBOM=Stream is shorter than its declared UTF-8 BOM
-LastSaveReferenceProvider.LastSaveReferenceProvider.error.wrongByteOrderMark=Stream has declared as UTF-8 BOM, but BOM does not match
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AbstractConfigurationBlockPreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AbstractConfigurationBlockPreferencePage.java
deleted file mode 100644
index b6c552791..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AbstractConfigurationBlockPreferencePage.java
+++ /dev/null
@@ -1,125 +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.ui.internal.editors.text;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferencePage;
-
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.WorkbenchHelp;
-
-/**
- * Abstract preference page which is used to wrap a
- * {@link org.eclipse.ui.internal.editors.text.IPreferenceConfigurationBlock}.
- *
- * @since 3.0
- */
-abstract class AbstractConfigurationBlockPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
-
- private IPreferenceConfigurationBlock fConfigurationBlock;
- private OverlayPreferenceStore fOverlayStore;
-
-
- /**
- * Creates a new preference page.
- */
- public AbstractConfigurationBlockPreferencePage() {
- setDescription();
- setPreferenceStore();
- fOverlayStore= new OverlayPreferenceStore(getPreferenceStore(), new OverlayPreferenceStore.OverlayKey[] {});
- fConfigurationBlock= createConfigurationBlock(fOverlayStore);
- }
-
- protected abstract IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore);
- protected abstract String getHelpId();
- protected abstract void setDescription();
- protected abstract void setPreferenceStore();
-
- /*
- * @see IWorkbenchPreferencePage#init()
- */
- public void init(IWorkbench workbench) {
- }
-
- /*
- * @see PreferencePage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- WorkbenchHelp.setHelp(getControl(), getHelpId());
- }
-
- /*
- * @see PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
-
- fOverlayStore.load();
- fOverlayStore.start();
-
- fConfigurationBlock.createControl(parent);
-
- initialize();
-
- Dialog.applyDialogFont(parent);
- return parent;
- }
-
- private void initialize() {
- fConfigurationBlock.initialize();
- }
-
- /*
- * @see PreferencePage#performOk()
- */
- public boolean performOk() {
-
- fConfigurationBlock.performOk();
-
- fOverlayStore.propagate();
-
- EditorsPlugin.getDefault().savePluginPreferences();
-
- return true;
- }
-
- /*
- * @see PreferencePage#performDefaults()
- */
- public void performDefaults() {
-
- fOverlayStore.loadDefaults();
- fConfigurationBlock.performDefaults();
-
- super.performDefaults();
- }
-
- /*
- * @see DialogPage#dispose()
- */
- public void dispose() {
-
- fConfigurationBlock.dispose();
-
- if (fOverlayStore != null) {
- fOverlayStore.stop();
- fOverlayStore= null;
- }
-
- super.dispose();
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsConfigurationBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsConfigurationBlock.java
deleted file mode 100644
index d68a25989..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsConfigurationBlock.java
+++ /dev/null
@@ -1,433 +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.ui.internal.editors.text;
-
-import java.text.Collator;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-
-import org.eclipse.jface.preference.PreferenceConverter;
-
-import org.eclipse.jface.text.Assert;
-
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.MarkerAnnotationPreferences;
-
-
-/**
- * Configures Annotation preferences.
- *
- * @since 3.0
- */
-class AnnotationsConfigurationBlock implements IPreferenceConfigurationBlock {
-
- private OverlayPreferenceStore fStore;
- private ColorEditor fAnnotationForegroundColorEditor;
-
- private Button fShowInTextCheckBox;
- private Combo fDecorationStyleCombo;
- private Button fHighlightInTextCheckBox;
- private Button fShowInOverviewRulerCheckBox;
- private Button fShowInVerticalRulerCheckBox;
-
- private List fAnnotationList;
- private final String[][] fAnnotationColorListModel;
-
-
- /**
- * List of master/slave listeners when there's a dependency.
- *
- * @see #createDependency(Button, String, Control)
- * @since 3.0
- */
- private ArrayList fMasterSlaveListeners= new ArrayList();
-
- private final String[][] fAnnotationDecorationListModel= new String[][] {
- {TextEditorMessages.getString("AnnotationConfigurationBlock.NONE"), AnnotationPreference.STYLE_NONE}, //$NON-NLS-1$
- {TextEditorMessages.getString("AnnotationConfigurationBlock.SQUIGGLES"), AnnotationPreference.STYLE_SQUIGGLES}, //$NON-NLS-1$
- {TextEditorMessages.getString("AnnotationConfigurationBlock.UNDERLINE"), AnnotationPreference.STYLE_UNDERLINE}, //$NON-NLS-1$
- {TextEditorMessages.getString("AnnotationConfigurationBlock.BOX"), AnnotationPreference.STYLE_BOX}, //$NON-NLS-1$
- {TextEditorMessages.getString("AnnotationConfigurationBlock.IBEAM"), AnnotationPreference.STYLE_IBEAM} //$NON-NLS-1$
- };
-
-
- public AnnotationsConfigurationBlock(OverlayPreferenceStore store) {
- Assert.isNotNull(store);
- MarkerAnnotationPreferences markerAnnotationPreferences= new MarkerAnnotationPreferences();
- fStore= store;
- fStore.addKeys(createOverlayStoreKeys(markerAnnotationPreferences));
- fAnnotationColorListModel= createAnnotationTypeListModel(markerAnnotationPreferences);
- }
-
- private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys(MarkerAnnotationPreferences preferences) {
-
- ArrayList overlayKeys= new ArrayList();
- Iterator e= preferences.getAnnotationPreferences().iterator();
-
- while (e.hasNext()) {
- AnnotationPreference info= (AnnotationPreference) e.next();
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey()));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getTextPreferenceKey()));
- if (info.getHighlightPreferenceKey() != null)
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getHighlightPreferenceKey()));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey()));
- if (info.getVerticalRulerPreferenceKey() != null)
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getVerticalRulerPreferenceKey()));
- if (info.getTextStylePreferenceKey() != null)
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getTextStylePreferenceKey()));
- }
- OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- public Control createControl(Composite parent) {
-
- PixelConverter pixelConverter= new PixelConverter(parent);
-
- Composite composite= new Composite(parent, SWT.NULL);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- composite.setLayout(layout);
-
- Label label= new Label(composite, SWT.LEFT);
- label.setText(TextEditorMessages.getString("AnnotationConfigurationBlock.annotationPresentationOptions")); //$NON-NLS-1$
- GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan= 2;
- label.setLayoutData(gd);
-
- Composite editorComposite= new Composite(composite, SWT.NONE);
- layout= new GridLayout();
- layout.numColumns= 2;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- editorComposite.setLayout(layout);
- gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
- gd.horizontalSpan= 2;
- editorComposite.setLayoutData(gd);
-
- fAnnotationList= new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
- gd= new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
- gd.heightHint= pixelConverter.convertHeightInCharsToPixels(20);
- fAnnotationList.setLayoutData(gd);
-
- Composite optionsComposite= new Composite(editorComposite, SWT.NONE);
- layout= new GridLayout();
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.numColumns= 2;
- optionsComposite.setLayout(layout);
- optionsComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- fShowInTextCheckBox= new Button(optionsComposite, SWT.CHECK);
- fShowInTextCheckBox.setText(TextEditorMessages.getString("AnnotationConfigurationBlock.showInText")); //$NON-NLS-1$
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment= GridData.BEGINNING;
- gd.horizontalSpan= 2;
- fShowInTextCheckBox.setLayoutData(gd);
-
- fDecorationStyleCombo= new Combo(optionsComposite, SWT.READ_ONLY);
- for(int i= 0; i < fAnnotationDecorationListModel.length; i++)
- fDecorationStyleCombo.add(fAnnotationDecorationListModel[i][0]);
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment= GridData.BEGINNING;
- gd.horizontalSpan= 2;
- gd.horizontalIndent= 20;
- fDecorationStyleCombo.setLayoutData(gd);
-
- fHighlightInTextCheckBox= new Button(optionsComposite, SWT.CHECK);
- fHighlightInTextCheckBox.setText(TextEditorMessages.getString("AnnotationConfigurationBlock.highlightInText")); //$NON-NLS-1$
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment= GridData.BEGINNING;
- gd.horizontalSpan= 2;
- fHighlightInTextCheckBox.setLayoutData(gd);
-
- fShowInOverviewRulerCheckBox= new Button(optionsComposite, SWT.CHECK);
- fShowInOverviewRulerCheckBox.setText(TextEditorMessages.getString("AnnotationConfigurationBlock.showInOverviewRuler")); //$NON-NLS-1$
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment= GridData.BEGINNING;
- gd.horizontalSpan= 2;
- fShowInOverviewRulerCheckBox.setLayoutData(gd);
-
- fShowInVerticalRulerCheckBox= new Button(optionsComposite, SWT.CHECK);
- fShowInVerticalRulerCheckBox.setText(TextEditorMessages.getString("AnnotationConfigurationBlock.showInVerticalRuler")); //$NON-NLS-1$
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment= GridData.BEGINNING;
- gd.horizontalSpan= 2;
- fShowInVerticalRulerCheckBox.setLayoutData(gd);
-
- label= new Label(optionsComposite, SWT.LEFT);
- label.setText(TextEditorMessages.getString("AnnotationConfigurationBlock.color")); //$NON-NLS-1$
- gd= new GridData();
- gd.horizontalAlignment= GridData.BEGINNING;
- label.setLayoutData(gd);
-
- fAnnotationForegroundColorEditor= new ColorEditor(optionsComposite);
- Button foregroundColorButton= fAnnotationForegroundColorEditor.getButton();
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment= GridData.BEGINNING;
- foregroundColorButton.setLayoutData(gd);
-
- fAnnotationList.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- handleAnnotationListSelection();
- }
- });
-
- fShowInTextCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- int i= fAnnotationList.getSelectionIndex();
- String key= fAnnotationColorListModel[i][2];
- fStore.setValue(key, fShowInTextCheckBox.getSelection());
- String decorationKey= fAnnotationColorListModel[i][6];
- fDecorationStyleCombo.setEnabled(decorationKey != null && fShowInTextCheckBox.getSelection());
- }
- });
-
- fHighlightInTextCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- int i= fAnnotationList.getSelectionIndex();
- String key= fAnnotationColorListModel[i][4];
- fStore.setValue(key, fHighlightInTextCheckBox.getSelection());
- }
- });
-
- fShowInOverviewRulerCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- int i= fAnnotationList.getSelectionIndex();
- String key= fAnnotationColorListModel[i][3];
- fStore.setValue(key, fShowInOverviewRulerCheckBox.getSelection());
- }
- });
-
- fShowInVerticalRulerCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- int i= fAnnotationList.getSelectionIndex();
- String key= fAnnotationColorListModel[i][5];
- fStore.setValue(key, fShowInVerticalRulerCheckBox.getSelection());
- }
- });
-
- foregroundColorButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- int i= fAnnotationList.getSelectionIndex();
- String key= fAnnotationColorListModel[i][1];
- PreferenceConverter.setValue(fStore, key, fAnnotationForegroundColorEditor.getColorValue());
- }
- });
-
- fDecorationStyleCombo.addSelectionListener(new SelectionListener() {
- /*
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- /*
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- int i= fAnnotationList.getSelectionIndex();
- String key= fAnnotationColorListModel[i][6];
- if (key != null) {
- for (int j= 0; j < fAnnotationDecorationListModel.length; j++) {
- if (fAnnotationDecorationListModel[j][0].equals(fDecorationStyleCombo.getText())) {
- fStore.setValue(key, fAnnotationDecorationListModel[j][1]);
- break;
- }
- }
- }
- }
- });
-
- return composite;
- }
-
- /*
- * @see PreferencePage#performOk()
- */
- public void performOk() {
-// restoreFromPreferences();
-// initializeFields();
- }
-
- /*
- * @see PreferencePage#performDefaults()
- */
- public void performDefaults() {
-
- fStore.loadDefaults();
- handleAnnotationListSelection();
- }
-
- private void handleAnnotationListSelection() {
- int i= fAnnotationList.getSelectionIndex();
-
- String key= fAnnotationColorListModel[i][1];
- RGB rgb= PreferenceConverter.getColor(fStore, key);
- fAnnotationForegroundColorEditor.setColorValue(rgb);
-
- key= fAnnotationColorListModel[i][2];
- boolean showInText = fStore.getBoolean(key);
- fShowInTextCheckBox.setSelection(showInText);
-
- key= fAnnotationColorListModel[i][6];
- if (key != null) {
- fDecorationStyleCombo.setEnabled(showInText);
- for (int j= 0; j < fAnnotationDecorationListModel.length; j++) {
- String value= fStore.getString(key);
- if (fAnnotationDecorationListModel[j][1].equals(value)) {
- fDecorationStyleCombo.setText(fAnnotationDecorationListModel[j][0]);
- break;
- }
- }
- } else {
- fDecorationStyleCombo.setEnabled(false);
- fDecorationStyleCombo.setText(fAnnotationDecorationListModel[1][0]); // set selection to squiggles if the key is not there (legacy support)
- }
-
- key= fAnnotationColorListModel[i][3];
- fShowInOverviewRulerCheckBox.setSelection(fStore.getBoolean(key));
-
- key= fAnnotationColorListModel[i][4];
- if (key != null) {
- fHighlightInTextCheckBox.setSelection(fStore.getBoolean(key));
- fHighlightInTextCheckBox.setEnabled(true);
- } else {
- fHighlightInTextCheckBox.setSelection(false);
- fHighlightInTextCheckBox.setEnabled(false);
- }
-
- key= fAnnotationColorListModel[i][5];
- if (key != null) {
- fShowInVerticalRulerCheckBox.setSelection(fStore.getBoolean(key));
- fShowInVerticalRulerCheckBox.setEnabled(true);
- } else {
- fShowInVerticalRulerCheckBox.setSelection(true);
- fShowInVerticalRulerCheckBox.setEnabled(false);
- }
- }
-
- public void initialize() {
-
- for (int i= 0; i < fAnnotationColorListModel.length; i++)
- fAnnotationList.add(fAnnotationColorListModel[i][0]);
- fAnnotationList.getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (fAnnotationList != null && !fAnnotationList.isDisposed()) {
- fAnnotationList.select(0);
- handleAnnotationListSelection();
- }
- }
- });
- }
-
- private String[][] createAnnotationTypeListModel(MarkerAnnotationPreferences preferences) {
- ArrayList listModelItems= new ArrayList();
- SortedSet sortedPreferences= new TreeSet(new Comparator() {
- /*
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
- if (!(o2 instanceof AnnotationPreference))
- return -1;
- if (!(o1 instanceof AnnotationPreference))
- return 1;
-
- AnnotationPreference a1= (AnnotationPreference)o1;
- AnnotationPreference a2= (AnnotationPreference)o2;
-
- return Collator.getInstance().compare(a1.getPreferenceLabel(), a2.getPreferenceLabel());
-
- }
- });
- sortedPreferences.addAll(preferences.getAnnotationPreferences());
- Iterator e= sortedPreferences.iterator();
- while (e.hasNext()) {
- AnnotationPreference info= (AnnotationPreference) e.next();
- if (info.isIncludeOnPreferencePage())
- listModelItems.add(new String[] { info.getPreferenceLabel(), info.getColorPreferenceKey(), info.getTextPreferenceKey(), info.getOverviewRulerPreferenceKey(), info.getHighlightPreferenceKey(), info.getVerticalRulerPreferenceKey(), info.getTextStylePreferenceKey()});
- }
- String[][] items= new String[listModelItems.size()][];
- listModelItems.toArray(items);
- return items;
- }
-
- private static void indent(Control control) {
- GridData gridData= new GridData();
- gridData.horizontalIndent= 20;
- control.setLayoutData(gridData);
- }
-
- private void createDependency(final Button master, String masterKey, final Control slave) {
- indent(slave);
- boolean masterState= fStore.getBoolean(masterKey);
- slave.setEnabled(masterState);
- SelectionListener listener= new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- slave.setEnabled(master.getSelection());
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {}
- };
- master.addSelectionListener(listener);
- fMasterSlaveListeners.add(listener);
- }
-
- /*
- * @see IPreferenceConfigurationBlock#dispose()
- */
- public void dispose() {
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsPreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsPreferencePage.java
deleted file mode 100644
index e19533ea3..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/AnnotationsPreferencePage.java
+++ /dev/null
@@ -1,54 +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.ui.internal.editors.text;
-
-
-
-/**
- * Annotations preference page.
- * <p>
- * Note: Must be public since it is referenced from plugin.xml
- * </p>
- *
- * @since 3.0
- */
-public class AnnotationsPreferencePage extends AbstractConfigurationBlockPreferencePage {
-
- /*
- * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#getHelpId()
- */
- protected String getHelpId() {
- return null; // FIXME: Needs help context ID
- }
-
- /*
- * @see org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setDescription()
- */
- protected void setDescription() {
- String description= TextEditorMessages.getString("AnnotationConfigurationBlock.description"); //$NON-NLS-1$
- setDescription(description);
- }
-
- /*
- * @see org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setPreferenceStore()
- */
- protected void setPreferenceStore() {
- setPreferenceStore(EditorsPlugin.getDefault().getPreferenceStore());
- }
-
- /*
- * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#createConfigurationBlock(org.eclipse.ui.internal.editors.text.OverlayPreferenceStore)
- */
- protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) {
- return new AnnotationsConfigurationBlock(overlayPreferenceStore);
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ColorEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ColorEditor.java
deleted file mode 100644
index d9d43e15d..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/ColorEditor.java
+++ /dev/null
@@ -1,159 +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.ui.internal.editors.text;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.ColorDialog;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.jface.resource.JFaceResources;
-
-/**
- * A "button" of a certain color determined by the color picker.
- *
- * @since 2.1
- */
-class ColorEditor {
-
- /** The extent. */
- private Point fExtent;
- /** The image for the push button. */
- private Image fImage;
- /** The current RGB color value. */
- private RGB fColorValue;
- /** The current color. */
- private Color fColor;
- /** The image push button which open the color dialog. */
- private Button fButton;
-
- /**
- * Creates and returns a new color editor.
- *
- * @param parent the parent composite of this color editor
- */
- public ColorEditor(Composite parent) {
-
- fButton= new Button(parent, SWT.PUSH);
- fExtent= computeImageSize(parent);
- fImage= new Image(parent.getDisplay(), fExtent.x, fExtent.y);
-
- GC gc= new GC(fImage);
- gc.setBackground(fButton.getBackground());
- gc.fillRectangle(0, 0, fExtent.x, fExtent.y);
- gc.dispose();
-
- fButton.setImage(fImage);
- fButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- ColorDialog colorDialog= new ColorDialog(fButton.getShell());
- colorDialog.setRGB(fColorValue);
- RGB newColor = colorDialog.open();
- if (newColor != null) {
- fColorValue= newColor;
- updateColorImage();
- }
- }
- });
-
- fButton.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- if (fImage != null) {
- fImage.dispose();
- fImage= null;
- }
- if (fColor != null) {
- fColor.dispose();
- fColor= null;
- }
- }
- });
- }
-
- /**
- * Returns the current RGB color value.
- *
- * @return an rgb with the current color value
- */
- public RGB getColorValue() {
- return fColorValue;
- }
-
- /**
- * Sets the current RGB color value.
- *
- * @param rgb the new value for the rgb color value
- */
- public void setColorValue(RGB rgb) {
- fColorValue= rgb;
- updateColorImage();
- }
-
- /**
- * Returns the image push button.
- *
- * @return the button which shows the current color as image
- */
- public Button getButton() {
- return fButton;
- }
-
- /**
- * Updates the color of the button image.
- */
- protected void updateColorImage() {
-
- Display display= fButton.getDisplay();
-
- GC gc= new GC(fImage);
- gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
- gc.drawRectangle(0, 2, fExtent.x - 1, fExtent.y - 4);
-
- if (fColor != null)
- fColor.dispose();
-
- fColor= new Color(display, fColorValue);
- gc.setBackground(fColor);
- gc.fillRectangle(1, 3, fExtent.x - 2, fExtent.y - 5);
- gc.dispose();
-
- fButton.setImage(fImage);
- }
-
-
- /**
- * Computes the size for the image.
- *
- * @param window the window on which to render the image
- * @return the point with the image size
- */
- protected Point computeImageSize(Control window) {
- GC gc= new GC(window);
- Font f= JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
- gc.setFont(f);
- int height= gc.getFontMetrics().getHeight();
- gc.dispose();
- Point p= new Point(height * 3 - 6, height);
- return p;
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java
deleted file mode 100644
index ef3bd096d..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java
+++ /dev/null
@@ -1,171 +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.ui.internal.editors.text;
-
-import org.osgi.framework.BundleContext;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import org.eclipse.jface.text.Assert;
-import org.eclipse.jface.text.source.ISharedTextColors;
-
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.editors.text.TextEditorPreferenceConstants;
-
-import org.eclipse.ui.internal.texteditor.AnnotationTypeHierarchy;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.texteditor.AnnotationPreferenceLookup;
-import org.eclipse.ui.texteditor.AnnotationTypeLookup;
-
-/**
- * Represents the editors plug-in. It provides a series of convenience methods such as
- * access to the shared text colors and the log.
- *
- * @since 2.1
- */
-public class EditorsPlugin extends AbstractUIPlugin {
- private static EditorsPlugin fgInstance;
-
- public static EditorsPlugin getDefault() {
- return fgInstance;
- }
-
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
- }
-
- public static void logErrorMessage(String message) {
- if (message == null)
- message= ""; //$NON-NLS-1$
- log(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IEditorsStatusConstants.INTERNAL_ERROR, message, null));
- }
-
- public static void logErrorStatus(String message, IStatus status) {
- if (status == null) {
- logErrorMessage(message);
- return;
- }
- MultiStatus multi= new MultiStatus(EditorsUI.PLUGIN_ID, IEditorsStatusConstants.INTERNAL_ERROR, message, null);
- multi.add(status);
- log(multi);
- }
-
- public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, EditorsUI.PLUGIN_ID, IEditorsStatusConstants.INTERNAL_ERROR, TextEditorMessages.getString("EditorsPlugin.internal_error"), e)); //$NON-NLS-1$
- }
-
-
-
- private FileEditorInputAdapterFactory fFileEditorInputAdapterFactory;
- private ISharedTextColors fSharedTextColors;
- private AnnotationTypeLookup fAnnotationTypeLookup;
- private AnnotationPreferenceLookup fAnnotationPreferenceLookup;
- private AnnotationTypeHierarchy fAnnotationTypeHierarchy;
-
- public EditorsPlugin() {
- Assert.isTrue(fgInstance == null);
- fgInstance= this;
- }
-
- /*
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore)
- */
- protected void initializeDefaultPreferences(IPreferenceStore store) {
- TextEditorPreferenceConstants.initializeDefaultValues(store);
- }
-
-
- /**
- * Returns the shared text colors of this plug-in.
- *
- * @return the shared text colors
- * @since 3.0
- */
- public ISharedTextColors getSharedTextColors() {
- if (fSharedTextColors == null)
- fSharedTextColors= new SharedTextColors();
- return fSharedTextColors;
- }
-
- /**
- * Returns the annotation type lookup of this plug-in.
- *
- * @return the annotation type lookup
- * @since 3.0
- */
- public AnnotationTypeLookup getAnnotationTypeLookup() {
- if (fAnnotationTypeLookup == null)
- fAnnotationTypeLookup= new AnnotationTypeLookup();
- return fAnnotationTypeLookup;
- }
-
- /**
- * Returns the annotation preference lookup of this plug-in.
- *
- * @return the annotation preference lookup
- * @since 3.0
- */
- public AnnotationPreferenceLookup getAnnotationPreferenceLookup() {
- if (fAnnotationPreferenceLookup == null)
- fAnnotationPreferenceLookup= new AnnotationPreferenceLookup();
- return fAnnotationPreferenceLookup;
- }
-
- /**
- * Returns the annotation type hierarchy for this plug-in.
- *
- * @return the annotation type hierarchy
- * @since 3.0
- */
- public AnnotationTypeHierarchy getAnnotationTypeHierarchy() {
- if (fAnnotationTypeHierarchy == null)
- fAnnotationTypeHierarchy= new AnnotationTypeHierarchy();
- return fAnnotationTypeHierarchy;
- }
-
- /*
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- * @since 3.0
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- fFileEditorInputAdapterFactory= new FileEditorInputAdapterFactory();
- IAdapterManager manager= Platform.getAdapterManager();
- manager.registerAdapters(fFileEditorInputAdapterFactory, IFile.class);
- }
-
- /*
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- * @since 3.0
- */
- public void stop(BundleContext context) throws Exception {
- IAdapterManager manager= Platform.getAdapterManager();
- manager.unregisterAdapters(fFileEditorInputAdapterFactory);
-
- if (fSharedTextColors != null) {
- fSharedTextColors.dispose();
- fSharedTextColors= null;
- }
-
- fAnnotationTypeLookup= null;
- fAnnotationPreferenceLookup= null;
- fAnnotationTypeHierarchy= null;
-
- super.stop(context);
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/FileEditorInputAdapterFactory.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/FileEditorInputAdapterFactory.java
deleted file mode 100644
index 97cd5b045..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/FileEditorInputAdapterFactory.java
+++ /dev/null
@@ -1,62 +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.ui.internal.editors.text;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.IPath;
-
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.editors.text.ILocationProvider;
-
-/**
- * @since 3.0
- */
-public class FileEditorInputAdapterFactory implements IAdapterFactory {
-
- private static class LocationProvider implements ILocationProvider {
- /*
- * @see org.eclipse.ui.editors.text.ILocationProvider#getLocation(java.lang.Object)
- */
- public IPath getPath(Object element) {
- if (element instanceof IFileEditorInput) {
- IFileEditorInput input= (IFileEditorInput) element;
- return input.getFile().getFullPath();
- }
- return null;
- }
- }
-
- /** The list of provided adapters. */
- private static final Class[] ADAPTER_LIST= new Class[] { ILocationProvider.class };
-
- /** The provided location provider */
- private ILocationProvider fLocationProvider= new LocationProvider();
-
- /*
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
- */
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (ILocationProvider.class.equals(adapterType)) {
- if (adaptableObject instanceof IFile)
- return fLocationProvider;
- }
- return null;
- }
-
- /*
- * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
- */
- public Class[] getAdapterList() {
- return ADAPTER_LIST;
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IEditorsStatusConstants.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IEditorsStatusConstants.java
deleted file mode 100644
index 2a9d7fb6d..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IEditorsStatusConstants.java
+++ /dev/null
@@ -1,28 +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.ui.internal.editors.text;
-
-/**
- * Defines plug-in-specific status codes.
- *
- * @see org.eclipse.core.runtime.IStatus#getCode()
- * @see org.eclipse.core.runtime.Status#Status(int, java.lang.String, int, java.lang.String, java.lang.Throwable)
- * @since 2.1
- */
-interface IEditorsStatusConstants {
-
- /**
- * Status constant indicating that an internal error occurred.
- * Value: <code>1001</code>
- */
- public static final int INTERNAL_ERROR= 10001;
-
- }
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IPreferenceConfigurationBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IPreferenceConfigurationBlock.java
deleted file mode 100644
index 536434bf1..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/IPreferenceConfigurationBlock.java
+++ /dev/null
@@ -1,64 +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.ui.internal.editors.text;
-
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * Interface for preference configuration blocks which can either be
- * wrapped by a {@link org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage}
- * or be included some preference page.
- * <p>
- * Clients may implement this interface.
- * </p>
- *
- * @since 3.0
- */
-interface IPreferenceConfigurationBlock {
-
- /**
- * Creates the preference control.
- *
- * @param parent the parent composite to which to add the preferences control
- * @return the control that was added to <code>parent</code>
- */
- Control createControl(Composite parent);
-
- /**
- * Called after creating the control. Implementations should load the
- * preferences values and update the controls accordingly.
- */
- void initialize();
-
- /**
- * Called when the <code>OK</code> button is pressed on the preference
- * page. Implementations should commit the configured preference settings
- * into their form of preference storage.
- */
- void performOk();
-
- /**
- * Called when the <code>Defaults</code> button is pressed on the
- * preference page. Implementation should reset any preference settings to
- * their default values and adjust the controls accordingly.
- */
- void performDefaults();
-
- /**
- * Called when the preference page is being disposed. Implementations should
- * free any resources they are holding on to.
- */
- void dispose();
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/JavaFileEditorInput.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/JavaFileEditorInput.java
deleted file mode 100644
index 048618fab..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/JavaFileEditorInput.java
+++ /dev/null
@@ -1,112 +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.ui.internal.editors.text;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-import org.eclipse.ui.editors.text.ILocationProvider;
-
-/**
- * @since 3.0
- */
-public class JavaFileEditorInput implements IEditorInput, ILocationProvider {
-
- private File fFile;
-
- public JavaFileEditorInput(File file) {
- super();
- fFile= file;
- }
- /*
- * @see org.eclipse.ui.IEditorInput#exists()
- */
- public boolean exists() {
- return fFile.exists();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getName()
- */
- public String getName() {
- return fFile.getName();
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getPersistable()
- */
- public IPersistableElement getPersistable() {
- return null;
- }
-
- /*
- * @see org.eclipse.ui.IEditorInput#getToolTipText()
- */
- public String getToolTipText() {
- return fFile.getAbsolutePath();
- }
-
- /*
- * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
- */
- public Object getAdapter(Class adapter) {
- if (ILocationProvider.class.equals(adapter))
- return this;
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
- /*
- * @see org.eclipse.ui.editors.text.ILocationProvider#getPath(java.lang.Object)
- */
- public IPath getPath(Object element) {
- if (element instanceof JavaFileEditorInput) {
- JavaFileEditorInput input= (JavaFileEditorInput) element;
- return new Path(input.fFile.getAbsolutePath());
- }
- return null;
- }
-
- /*
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object o) {
- if (o == this)
- return true;
-
- if (o instanceof JavaFileEditorInput) {
- JavaFileEditorInput input = (JavaFileEditorInput) o;
- return fFile.equals(input.fFile);
- }
-
- return false;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- return fFile.hashCode();
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPreviousPulldownActionDelegate.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPreviousPulldownActionDelegate.java
deleted file mode 100644
index 45b4f1396..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPreviousPulldownActionDelegate.java
+++ /dev/null
@@ -1,192 +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.ui.internal.editors.text;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ISelection;
-
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.MarkerAnnotationPreferences;
-
-/**
- * The abstract class for next and previous pulldown action delegates.
- *
- * @since 3.0
- */
-public abstract class NextPreviousPulldownActionDelegate extends Action implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
-
- /** The cached menu. */
- private Menu fMenu;
-
- /** The preference store */
- private IPreferenceStore fStore;
-
- /** Action for handling menu item selection. */
- private static class NavigationEnablementAction extends Action {
-
- /** The preference store. */
- private IPreferenceStore fStore;
-
- /** The preference key for the value in the store. */
- private String fKey;
-
- /**
- * Creates a named navigation enablement action.
- *
- * @param name the name of this action
- * @param store the preference store
- * @param key the preference key
- */
- public NavigationEnablementAction(String name, IPreferenceStore store, String key) {
- super(name, IAction.AS_CHECK_BOX);
- fStore= store;
- fKey= key;
- setChecked(fStore.getBoolean(fKey));
- }
-
- /*
- * @see IAction#run()
- */
- public void run() {
- fStore.setValue(fKey, isChecked());
- }
- }
-
- /**
- * Returns the preference key to be used in the
- * <code>NavigationEnablementAction</code>.
- *
- * @param annotationPreference the annotation preference
- * @return the preference key or <code>null</code> if the key is not defined in XML
- */
- public abstract String getPreferenceKey(AnnotationPreference annotationPreference);
-
- /*
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
- */
- public Menu getMenu(Control parent) {
- if (fMenu != null)
- fMenu.dispose();
-
- fMenu= new Menu(parent);
- fillMenu(fMenu);
-
- return fMenu;
- }
-
- /**
- * Creates a next previous action delegate.
- */
- public NextPreviousPulldownActionDelegate() {
- fStore= EditorsPlugin.getDefault().getPreferenceStore();
- }
-
- /*
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
- */
- public Menu getMenu(Menu parent) {
- if (fMenu == null) {
- fMenu= new Menu(parent);
- fillMenu(fMenu);
- }
-
- return fMenu;
- }
-
- /*
- * @see org.eclipse.jface.action.IMenuCreator#dispose()
- */
- public void dispose() {
- if (fMenu != null) {
- fMenu.dispose();
- fMenu= null;
- }
- }
-
- /**
- * Fills the given menu using marker
- * annotation preferences.
- *
- * @param menu the menu to fill
- */
- private void fillMenu(Menu menu) {
- IAction[] actions= getActionsFromDescriptors();
-
- for (int i= 0; i < actions.length; i++) {
- ActionContributionItem item= new ActionContributionItem(actions[i]);
- item.fill(menu, -1);
- }
- }
-
- /**
- * Creates actions using marker
- * annotation preferences.
- *
- * @return the navigation enablement actions
- */
- private IAction[] getActionsFromDescriptors() {
- MarkerAnnotationPreferences fMarkerAnnotationPreferences= new MarkerAnnotationPreferences();
- ArrayList containers= new ArrayList();
-
- Iterator iter= fMarkerAnnotationPreferences.getAnnotationPreferences().iterator();
- while (iter.hasNext()) {
- AnnotationPreference preference= (AnnotationPreference)iter.next();
- String key= preference.getShowInNextPrevDropdownToolbarActionKey();
- if (key != null && fStore.getBoolean(key)) {
- String preferenceKey= getPreferenceKey(preference);
-
- /*
- * Fixes bug 41689
- * This code can be simplified if we decide that
- * we don't allow to use different settings for go to
- * previous and go to next annotation.
- */
- preferenceKey= preference.getIsGoToNextNavigationTargetKey();
-
- if (preferenceKey != null)
- containers.add(new NavigationEnablementAction(preference.getPreferenceLabel(), fStore, preferenceKey));
- }
- }
-
- return (IAction[]) containers.toArray(new Action[containers.size()]);
- }
-
- /*
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPulldownActionDelegate.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPulldownActionDelegate.java
deleted file mode 100644
index d6b44d4e0..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/NextPulldownActionDelegate.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.ui.internal.editors.text;
-
-import org.eclipse.ui.texteditor.AnnotationPreference;
-
-/**
- * The next pulldown action delegate.
- *
- * @since 3.0
- */
-public class NextPulldownActionDelegate extends NextPreviousPulldownActionDelegate {
-
- /*
- * @see org.eclipse.ui.internal.texteditor.NextPreviousPulldownActionDelegate#getPreferenceKey(AnnotationPreference)
- */
- public String getPreferenceKey(AnnotationPreference annotationPreference) {
- return annotationPreference.getIsGoToNextNavigationTargetKey();
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OpenExternalFileAction.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OpenExternalFileAction.java
deleted file mode 100644
index c1309eb7a..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OpenExternalFileAction.java
+++ /dev/null
@@ -1,162 +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.ui.internal.editors.text;
-
-import java.io.File;
-import java.text.MessageFormat;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.FileDialog;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @since 3.0
- */
-public class OpenExternalFileAction extends Action implements IWorkbenchWindowActionDelegate {
-
- static class FileLabelProvider extends LabelProvider {
- /*
- * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
- */
- public String getText(Object element) {
- if (element instanceof IFile) {
- IPath path= ((IFile) element).getFullPath();
- return path != null ? path.toString() : ""; //$NON-NLS-1$
- }
- return super.getText(element);
- }
- }
-
-
- private IWorkbenchWindow fWindow;
-
- public OpenExternalFileAction() {
- setEnabled(true);
- }
-
- /*
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- fWindow= null;
- }
-
- /*
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- fWindow= window;
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- run();
- }
-
- /*
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- private File queryFile() {
- FileDialog dialog= new FileDialog(fWindow.getShell(), SWT.OPEN);
- dialog.setText(TextEditorMessages.getString("OpenExternalFileAction.dialog.text")); //$NON-NLS-1$
- String path= dialog.open();
- if (path != null && path.length() > 0)
- return new File(path);
- return null;
- }
-
- /*
- * @see org.eclipse.jface.action.Action#run()
- */
- public void run() {
- File file= queryFile();
- if (file != null && file.exists()) {
- IEditorInput input= createEditorInput(file);
- String editorId= getEditorId(file);
- IWorkbenchPage page= fWindow.getActivePage();
- try {
- page.openEditor(input, editorId);
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- } else if (file != null) {
- String msgFmt = TextEditorMessages.getString("OpenExternalFileAction.FileNotFound"); //$NON-NLS-1$
- String msg = MessageFormat.format(msgFmt, new String[] {file.getName()});
- MessageDialog.openWarning(fWindow.getShell(), TextEditorMessages.getString("OpenExternalFileAction.dialog.text"), msg); //$NON-NLS-1$
- }
- }
-
- private String getEditorId(File file) {
- IWorkbench workbench= fWindow.getWorkbench();
- IEditorRegistry editorRegistry= workbench.getEditorRegistry();
- IEditorDescriptor descriptor= editorRegistry.getDefaultEditor(file.getName());
- if (descriptor != null)
- return descriptor.getId();
- return EditorsUI.DEFAULT_TEXT_EDITOR_ID;
- }
-
- private IEditorInput createEditorInput(File file) {
- IFile workspaceFile= getWorkspaceFile(file);
- if (workspaceFile != null)
- return new FileEditorInput(workspaceFile);
- return new JavaFileEditorInput(file);
- }
-
- private IFile getWorkspaceFile(File file) {
- IWorkspace workspace= ResourcesPlugin.getWorkspace();
- IPath location= new Path(file.getAbsolutePath());
- IFile[] files= workspace.getRoot().findFilesForLocation(location);
- if (files == null || files.length == 0)
- return null;
- if (files.length == 1)
- return files[0];
- return selectWorkspaceFile(files);
- }
-
- private IFile selectWorkspaceFile(IFile[] files) {
- ElementListSelectionDialog dialog= new ElementListSelectionDialog(fWindow.getShell(), new FileLabelProvider());
- dialog.setElements(files);
- dialog.setTitle(TextEditorMessages.getString("OpenExternalFileAction.SelectWorkspaceFile")); //$NON-NLS-1$
- dialog.setMessage(TextEditorMessages.getString("OpenExternalFileAction.FileLinkedtoMultiple")); //$NON-NLS-1$
- if (dialog.open() == Window.OK)
- return (IFile) dialog.getFirstResult();
- return null;
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OverlayPreferenceStore.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OverlayPreferenceStore.java
deleted file mode 100644
index c0c24edc0..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/OverlayPreferenceStore.java
+++ /dev/null
@@ -1,547 +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.ui.internal.editors.text;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceStore;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-import org.eclipse.jface.text.Assert;
-
-/**
- * An overlaying preference store.
- *
- * @since 2.1
- */
-class OverlayPreferenceStore implements IPreferenceStore {
-
-
- /**
- * Descriptor used to denote data types.
- */
- public static final class TypeDescriptor {
- private TypeDescriptor() {
- }
- }
-
- public static final TypeDescriptor BOOLEAN= new TypeDescriptor();
- public static final TypeDescriptor DOUBLE= new TypeDescriptor();
- public static final TypeDescriptor FLOAT= new TypeDescriptor();
- public static final TypeDescriptor INT= new TypeDescriptor();
- public static final TypeDescriptor LONG= new TypeDescriptor();
- public static final TypeDescriptor STRING= new TypeDescriptor();
-
- /**
- * Data structure for the overlay key.
- */
- public static class OverlayKey {
-
- TypeDescriptor fDescriptor;
- String fKey;
-
- public OverlayKey(TypeDescriptor descriptor, String key) {
- fDescriptor= descriptor;
- fKey= key;
- }
- }
-
- /*
- * @see IPropertyChangeListener
- */
- private class PropertyListener implements IPropertyChangeListener {
-
- /*
- * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- OverlayKey key= findOverlayKey(event.getProperty());
- if (key != null)
- propagateProperty(fParent, key, fStore);
- }
- }
-
-
- /** The parent preference store. */
- private IPreferenceStore fParent;
- /** This store. */
- private IPreferenceStore fStore;
- /** The keys of this store. */
- private OverlayKey[] fOverlayKeys;
- /** The property listener. */
- private PropertyListener fPropertyListener;
- private boolean fLoaded;
-
-
- /**
- * Creates and returns a new overlay preference store.
- *
- * @param parent the parent preference store
- * @param overlayKeys the overlay keys
- */
- public OverlayPreferenceStore(IPreferenceStore parent, OverlayKey[] overlayKeys) {
- fParent= parent;
- fOverlayKeys= overlayKeys;
- fStore= new PreferenceStore();
- }
-
- /**
- * Tries to find and return the overlay key for the given preference key string.
- *
- * @param key the preference key string
- * @return the overlay key or <code>null</code> if none can be found
- */
- private OverlayKey findOverlayKey(String key) {
- for (int i= 0; i < fOverlayKeys.length; i++) {
- if (fOverlayKeys[i].fKey.equals(key))
- return fOverlayKeys[i];
- }
- return null;
- }
-
- /**
- * Tells whether the given preference key string is
- * covered by this overlay store.
- *
- * @param key the preference key string
- * @return <code>true</code> if this overlay store covers the given key
- */
- private boolean covers(String key) {
- return (findOverlayKey(key) != null);
- }
-
- /**
- * Propagates the given overlay key from the orgin to the target preference store.
- *
- * @param orgin the source preference store
- * @param key the overlay key
- * @param target the preference store to which the key is propagated
- */
- private void propagateProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target) {
-
- if (orgin.isDefault(key.fKey)) {
- if (!target.isDefault(key.fKey))
- target.setToDefault(key.fKey);
- return;
- }
-
- TypeDescriptor d= key.fDescriptor;
- if (BOOLEAN == d) {
-
- boolean originValue= orgin.getBoolean(key.fKey);
- boolean targetValue= target.getBoolean(key.fKey);
- if (targetValue != originValue)
- target.setValue(key.fKey, originValue);
-
- } else if (DOUBLE == d) {
-
- double originValue= orgin.getDouble(key.fKey);
- double targetValue= target.getDouble(key.fKey);
- if (targetValue != originValue)
- target.setValue(key.fKey, originValue);
-
- } else if (FLOAT == d) {
-
- float originValue= orgin.getFloat(key.fKey);
- float targetValue= target.getFloat(key.fKey);
- if (targetValue != originValue)
- target.setValue(key.fKey, originValue);
-
- } else if (INT == d) {
-
- int originValue= orgin.getInt(key.fKey);
- int targetValue= target.getInt(key.fKey);
- if (targetValue != originValue)
- target.setValue(key.fKey, originValue);
-
- } else if (LONG == d) {
-
- long originValue= orgin.getLong(key.fKey);
- long targetValue= target.getLong(key.fKey);
- if (targetValue != originValue)
- target.setValue(key.fKey, originValue);
-
- } else if (STRING == d) {
-
- String originValue= orgin.getString(key.fKey);
- String targetValue= target.getString(key.fKey);
- if (targetValue != null && originValue != null && !targetValue.equals(originValue))
- target.setValue(key.fKey, originValue);
-
- }
- }
-
- /**
- * Propagates all overlay keys from this store to the parent store.
- */
- public void propagate() {
- for (int i= 0; i < fOverlayKeys.length; i++)
- propagateProperty(fStore, fOverlayKeys[i], fParent);
- }
-
- /**
- * Loads the given key from the orgin into the target.
- *
- * @param orgin the source preference store
- * @param key the overlay key
- * @param target the preference store to which the key is propagated
- * @param forceInitialization if <code>true</code> the value in the target gets initialized before loading
- */
- private void loadProperty(IPreferenceStore orgin, OverlayKey key, IPreferenceStore target, boolean forceInitialization) {
- TypeDescriptor d= key.fDescriptor;
- if (BOOLEAN == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, true);
- target.setValue(key.fKey, orgin.getBoolean(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultBoolean(key.fKey));
-
- } else if (DOUBLE == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, 1.0D);
- target.setValue(key.fKey, orgin.getDouble(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultDouble(key.fKey));
-
- } else if (FLOAT == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, 1.0F);
- target.setValue(key.fKey, orgin.getFloat(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultFloat(key.fKey));
-
- } else if (INT == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, 1);
- target.setValue(key.fKey, orgin.getInt(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultInt(key.fKey));
-
- } else if (LONG == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, 1L);
- target.setValue(key.fKey, orgin.getLong(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultLong(key.fKey));
-
- } else if (STRING == d) {
-
- if (forceInitialization)
- target.setValue(key.fKey, "1"); //$NON-NLS-1$
- target.setValue(key.fKey, orgin.getString(key.fKey));
- target.setDefault(key.fKey, orgin.getDefaultString(key.fKey));
-
- }
- }
-
- /**
- * Loads the values from the parent into this store.
- */
- public void load() {
- for (int i= 0; i < fOverlayKeys.length; i++)
- loadProperty(fParent, fOverlayKeys[i], fStore, true);
-
- fLoaded= true;
- }
-
- /**
- * Loads the default values.
- */
- public void loadDefaults() {
- for (int i= 0; i < fOverlayKeys.length; i++)
- setToDefault(fOverlayKeys[i].fKey);
- }
-
- /**
- * Starts to listen for changes.
- */
- public void start() {
- if (fPropertyListener == null) {
- fPropertyListener= new PropertyListener();
- fParent.addPropertyChangeListener(fPropertyListener);
- }
- }
-
- /**
- * Stops to listen for changes.
- */
- public void stop() {
- if (fPropertyListener != null) {
- fParent.removePropertyChangeListener(fPropertyListener);
- fPropertyListener= null;
- }
- }
-
- /*
- * @see IPreferenceStore#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- fStore.addPropertyChangeListener(listener);
- }
-
- /*
- * @see IPreferenceStore#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- fStore.removePropertyChangeListener(listener);
- }
-
- /*
- * @see IPreferenceStore#firePropertyChangeEvent(java.lang.String, java.lang.Object, java.lang.Object)
- */
- public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) {
- fStore.firePropertyChangeEvent(name, oldValue, newValue);
- }
-
- /*
- * @see IPreferenceStore#contains(java.lang.String)
- */
- public boolean contains(String name) {
- return fStore.contains(name);
- }
-
- /*
- * @see IPreferenceStore#getBoolean(java.lang.String)
- */
- public boolean getBoolean(String name) {
- return fStore.getBoolean(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultBoolean(java.lang.String)
- */
- public boolean getDefaultBoolean(String name) {
- return fStore.getDefaultBoolean(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultDouble(java.lang.String)
- */
- public double getDefaultDouble(String name) {
- return fStore.getDefaultDouble(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultFloat(String)
- */
- public float getDefaultFloat(String name) {
- return fStore.getDefaultFloat(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultInt(String)
- */
- public int getDefaultInt(String name) {
- return fStore.getDefaultInt(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultLong(String)
- */
- public long getDefaultLong(String name) {
- return fStore.getDefaultLong(name);
- }
-
- /*
- * @see IPreferenceStore#getDefaultString(String)
- */
- public String getDefaultString(String name) {
- return fStore.getDefaultString(name);
- }
-
- /*
- * @see IPreferenceStore#getDouble(String)
- */
- public double getDouble(String name) {
- return fStore.getDouble(name);
- }
-
- /*
- * @see IPreferenceStore#getFloat(String)
- */
- public float getFloat(String name) {
- return fStore.getFloat(name);
- }
-
- /*
- * @see IPreferenceStore#getInt(String)
- */
- public int getInt(String name) {
- return fStore.getInt(name);
- }
-
- /*
- * @see IPreferenceStore#getLong(String)
- */
- public long getLong(String name) {
- return fStore.getLong(name);
- }
-
- /*
- * @see IPreferenceStore#getString(String)
- */
- public String getString(String name) {
- return fStore.getString(name);
- }
-
- /*
- * @see IPreferenceStore#isDefault(String)
- */
- public boolean isDefault(String name) {
- return fStore.isDefault(name);
- }
-
- /*
- * @see IPreferenceStore#needsSaving()
- */
- public boolean needsSaving() {
- return fStore.needsSaving();
- }
-
- /*
- * @see IPreferenceStore#putValue(String, String)
- */
- public void putValue(String name, String value) {
- if (covers(name))
- fStore.putValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, double)
- */
- public void setDefault(String name, double value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, float)
- */
- public void setDefault(String name, float value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, int)
- */
- public void setDefault(String name, int value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, long)
- */
- public void setDefault(String name, long value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, String)
- */
- public void setDefault(String name, String value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setDefault(String, boolean)
- */
- public void setDefault(String name, boolean value) {
- if (covers(name))
- fStore.setDefault(name, value);
- }
-
- /*
- * @see IPreferenceStore#setToDefault(String)
- */
- public void setToDefault(String name) {
- fStore.setToDefault(name);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, double)
- */
- public void setValue(String name, double value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, float)
- */
- public void setValue(String name, float value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, int)
- */
- public void setValue(String name, int value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, long)
- */
- public void setValue(String name, long value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, String)
- */
- public void setValue(String name, String value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /*
- * @see IPreferenceStore#setValue(String, boolean)
- */
- public void setValue(String name, boolean value) {
- if (covers(name))
- fStore.setValue(name, value);
- }
-
- /**
- * The keys to add to the list of overlay keys.
- * <p>
- * Note: This method must be called before {@link #load()} is called.
- * </p>
- *
- * @param keys
- * @since 3.0
- */
- public void addKeys(OverlayKey[] keys) {
- Assert.isTrue(!fLoaded);
- Assert.isNotNull(keys);
-
- int overlayKeysLength= fOverlayKeys.length;
- OverlayKey[] result= new OverlayKey[keys.length + overlayKeysLength];
-
- for (int i= 0, length= overlayKeysLength; i < length; i++)
- result[i]= fOverlayKeys[i];
-
- for (int i= 0, length= keys.length; i < length; i++)
- result[overlayKeysLength + i]= keys[i];
-
- fOverlayKeys= result;
-
- if (fLoaded)
- load();
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PixelConverter.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PixelConverter.java
deleted file mode 100644
index 3dc591f02..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PixelConverter.java
+++ /dev/null
@@ -1,62 +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.ui.internal.editors.text;
-
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Control;
-
-import org.eclipse.jface.dialogs.Dialog;
-
-/**
- * Pixel conversion utility.
- *
- * @since 3.0
- */
-class PixelConverter {
-
- private FontMetrics fFontMetrics;
-
- public PixelConverter(Control control) {
- GC gc = new GC(control);
- gc.setFont(control.getFont());
- fFontMetrics= gc.getFontMetrics();
- gc.dispose();
- }
-
- /*
- * @see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int)
- */
- public int convertHeightInCharsToPixels(int chars) {
- return Dialog.convertHeightInCharsToPixels(fFontMetrics, chars);
- }
-
- /*
- * @see org.eclipse.jface.dialogs.DialogPage#convertHorizontalDLUsToPixels(int)
- */
- public int convertHorizontalDLUsToPixels(int dlus) {
- return Dialog.convertHorizontalDLUsToPixels(fFontMetrics, dlus);
- }
-
- /*
- * @see org.eclipse.jface.dialogs.DialogPage#convertVerticalDLUsToPixels(int)
- */
- public int convertVerticalDLUsToPixels(int dlus) {
- return Dialog.convertVerticalDLUsToPixels(fFontMetrics, dlus);
- }
-
- /*
- * @see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int)
- */
- public int convertWidthInCharsToPixels(int chars) {
- return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars);
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PreviousPulldownActionDelegate.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PreviousPulldownActionDelegate.java
deleted file mode 100644
index 62e39dd4c..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/PreviousPulldownActionDelegate.java
+++ /dev/null
@@ -1,30 +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.ui.internal.editors.text;
-
-import org.eclipse.ui.texteditor.AnnotationPreference;
-
-/**
- * The previous pulldown action delegate.
- *
- * @since 3.0
- */
-public class PreviousPulldownActionDelegate extends NextPreviousPulldownActionDelegate {
-
- /*
- * @see org.eclipse.ui.internal.texteditor.NextPreviousPulldownActionDelegate#getPreferenceKey(AnnotationPreference)
- */
- public String getPreferenceKey(AnnotationPreference annotationPreference) {
- return annotationPreference.getIsGoToPreviousNavigationTargetKey();
- }
-
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java
deleted file mode 100644
index 61ae568b1..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java
+++ /dev/null
@@ -1,406 +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.ui.internal.editors.text;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-
-import org.eclipse.jface.preference.PreferenceConverter;
-
-import org.eclipse.jface.text.Assert;
-
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.MarkerAnnotationPreferences;
-import org.eclipse.ui.texteditor.quickdiff.QuickDiff;
-import org.eclipse.ui.texteditor.quickdiff.ReferenceProviderDescriptor;
-
-/**
- * Configures quick diff preferences
- *
- * @since 3.0
- */
-class QuickDiffConfigurationBlock implements IPreferenceConfigurationBlock {
-
- private OverlayPreferenceStore fStore;
-
- private Map fCheckBoxes= new HashMap();
- private SelectionListener fCheckBoxListener= new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- public void widgetSelected(SelectionEvent e) {
- Button button= (Button) e.widget;
- fStore.setValue((String) fCheckBoxes.get(button), button.getSelection());
- }
- };
-
- /**
- * List for the reference provider default.
- * @since 3.0
- */
- private org.eclipse.swt.widgets.List fQuickDiffProviderList;
- /**
- * The reference provider default's list model.
- * @since 3.0
- */
- private String[][] fQuickDiffProviderListModel;
- /**
- * Button controlling default setting of the selected reference provider.
- * @since 3.0
- */
- private Button fSetDefaultButton;
- /**
- * The quick diff color model.
- * @since 3.0
- */
- private String[][] fQuickDiffModel;
- /**
- * The color editors for quick diff.
- * @since 3.0
- */
- private ColorEditor[] fQuickDiffColorEditors;
- /**
- * The checkbox for the quick diff overview ruler property.
- * @since 3.0
- */
- private Button fQuickDiffOverviewRulerCheckBox;
-
-
-
- public QuickDiffConfigurationBlock(OverlayPreferenceStore store) {
- Assert.isNotNull(store);
- fStore= store;
- MarkerAnnotationPreferences markerAnnotationPreferences= new MarkerAnnotationPreferences();
- fStore.addKeys(createOverlayStoreKeys(markerAnnotationPreferences));
- fQuickDiffModel= createQuickDiffModel(markerAnnotationPreferences);
- fQuickDiffProviderListModel= createQuickDiffReferenceListModel();
- }
-
- private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys(MarkerAnnotationPreferences preferences) {
- ArrayList overlayKeys= new ArrayList();
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_CHARACTER_MODE));
-
- Iterator e= preferences.getAnnotationPreferences().iterator();
- while (e.hasNext()) {
- AnnotationPreference info= (AnnotationPreference) e.next();
-
- if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffChange") //$NON-NLS-1$
- || (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffAddition")) //$NON-NLS-1$
- || (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffDeletion")) //$NON-NLS-1$
- ) {
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, info.getColorPreferenceKey()));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, info.getOverviewRulerPreferenceKey()));
- }
- }
-
- OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return keys;
- }
-
- private String[][] createQuickDiffModel(MarkerAnnotationPreferences preferences) {
- String[][] items= new String[3][];
-
- Iterator e= preferences.getAnnotationPreferences().iterator();
- while (e.hasNext()) {
- AnnotationPreference info= (AnnotationPreference) e.next();
- if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffChange")) //$NON-NLS-1$
- items[0]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.getString("QuickDiffConfigurationBlock.changeColor") }; //$NON-NLS-1$
- else if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffAddition")) //$NON-NLS-1$
- items[1]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.getString("QuickDiffConfigurationBlock.additionColor") }; //$NON-NLS-1$
- else if (info.getAnnotationType().equals("org.eclipse.ui.workbench.texteditor.quickdiffDeletion")) //$NON-NLS-1$
- items[2]= new String[] { info.getColorPreferenceKey(), info.getOverviewRulerPreferenceKey(), TextEditorMessages.getString("QuickDiffConfigurationBlock.deletionColor") }; //$NON-NLS-1$
- }
- return items;
- }
-
- private String[][] createQuickDiffReferenceListModel() {
- java.util.List descriptors= new QuickDiff().getReferenceProviderDescriptors();
- ArrayList listModelItems= new ArrayList();
- for (Iterator it= descriptors.iterator(); it.hasNext();) {
- ReferenceProviderDescriptor descriptor= (ReferenceProviderDescriptor) it.next();
- String label= descriptor.getLabel();
- int i= label.indexOf('&');
- while (i >= 0) {
- if (i < label.length())
- label= label.substring(0, i) + label.substring(i+1);
- else
- label.substring(0, i);
- i= label.indexOf('&');
- }
- listModelItems.add(new String[] { descriptor.getId(), label });
- }
- String[][] items= new String[listModelItems.size()][];
- listModelItems.toArray(items);
- return items;
- }
-
- private Button addCheckBox(Composite parent, String label, String key, int indentation) {
- Button checkBox= new Button(parent, SWT.CHECK);
- checkBox.setText(label);
-
- GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalIndent= indentation;
- gd.horizontalSpan= 2;
- checkBox.setLayoutData(gd);
- checkBox.addSelectionListener(fCheckBoxListener);
-
- fCheckBoxes.put(checkBox, key);
-
- return checkBox;
- }
-
- /**
- * Creates page for hover preferences.
- *
- * @param parent the parent composite
- * @return the created child composite
- */
- public Control createControl(Composite parent) {
- Composite composite= new Composite(parent, SWT.NONE);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout= new GridLayout();
- layout.numColumns= 2;
- composite.setLayout(layout);
-
- String label= TextEditorMessages.getString("QuickDiffConfigurationBlock.showForNewEditors"); //$NON-NLS-1$
- addCheckBox(composite, label, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_ALWAYS_ON, 0);
-
- label= TextEditorMessages.getString("QuickDiffConfigurationBlock.characterMode"); //$NON-NLS-1$
- addCheckBox(composite, label, AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_CHARACTER_MODE, 0);
-
- label= TextEditorMessages.getString("QuickDiffConfigurationBlock.showInOverviewRuler"); //$NON-NLS-1$
- fQuickDiffOverviewRulerCheckBox= new Button(composite, SWT.CHECK);
- fQuickDiffOverviewRulerCheckBox.setText(label);
-
- GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalIndent= 0;
- gd.horizontalSpan= 2;
- fQuickDiffOverviewRulerCheckBox.setLayoutData(gd);
- fQuickDiffOverviewRulerCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- for (int i= 0; i < fQuickDiffModel.length; i++) {
- fStore.setValue(fQuickDiffModel[i][1], fQuickDiffOverviewRulerCheckBox.getSelection());
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
-
- // spacer
- Label l= new Label(composite, SWT.LEFT );
- gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan= 2;
- gd.heightHint= 5;
- l.setLayoutData(gd);
-
- Group group= new Group(composite, SWT.NONE);
- group.setText(TextEditorMessages.getString("QuickDiffConfigurationBlock.colorTitle")); //$NON-NLS-1$
- layout= new GridLayout();
- layout.numColumns= 2;
- group.setLayout(layout);
- gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalSpan= 2;
- group.setLayoutData(gd);
-
- fQuickDiffColorEditors= new ColorEditor[3];
- for (int i= 0; i < fQuickDiffModel.length; i++) {
- label= fQuickDiffModel[i][2];
- l= new Label(group, SWT.LEFT);
- l.setText(label);
- final ColorEditor editor= new ColorEditor(group);
- fQuickDiffColorEditors[i]= editor;
- Button changeColorButton= editor.getButton();
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment= GridData.BEGINNING;
- changeColorButton.setLayoutData(gd);
- final int index= i;
- changeColorButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- String key= fQuickDiffModel[index][0];
- PreferenceConverter.setValue(fStore, key, editor.getColorValue());
- }
- });
- }
-
-
- // spacer
- l= new Label(composite, SWT.LEFT );
- gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan= 2;
- gd.heightHint= 5;
- l.setLayoutData(gd);
-
- l= new Label(composite, SWT.LEFT);
- l.setText(TextEditorMessages.getString("QuickDiffConfigurationBlock.referenceProviderTitle")); //$NON-NLS-1$
- gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan= 2;
- l.setLayoutData(gd);
-
- Composite editorComposite= new Composite(composite, SWT.NONE);
- layout= new GridLayout();
- layout.numColumns= 2;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- editorComposite.setLayout(layout);
- gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
- gd.horizontalSpan= 2;
- editorComposite.setLayoutData(gd);
-
- fQuickDiffProviderList= new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
- gd= new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
- gd.heightHint= 60;
- fQuickDiffProviderList.setLayoutData(gd);
-
- Composite stylesComposite= new Composite(editorComposite, SWT.NONE);
- layout= new GridLayout();
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.numColumns= 2;
- stylesComposite.setLayout(layout);
- stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- fSetDefaultButton= new Button(stylesComposite, SWT.PUSH);
- fSetDefaultButton.setText(TextEditorMessages.getString("QuickDiffConfigurationBlock.setDefault")); //$NON-NLS-1$
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment= GridData.BEGINNING;
- gd.horizontalSpan= 2;
- fSetDefaultButton.setLayoutData(gd);
-
- fQuickDiffProviderList.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- handleProviderListSelection();
- }
-
- });
-
- fSetDefaultButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
-
- public void widgetSelected(SelectionEvent e) {
- int i= fQuickDiffProviderList.getSelectionIndex();
- fStore.setValue(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER, fQuickDiffProviderListModel[i][0]);
- updateProviderList();
- }
- });
-
- return composite;
- }
-
- private void updateProviderList() {
- int i= fQuickDiffProviderList.getSelectionIndex();
- int defaultIndex= -1;
- String defaultProvider= fStore.getString(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER);
- for (int j= 0; j < fQuickDiffProviderListModel.length; j++) {
- fQuickDiffProviderList.remove(j);
- if (defaultProvider.equals(fQuickDiffProviderListModel[j][0])) {
- fQuickDiffProviderList.add(fQuickDiffProviderListModel[j][1] + " " + TextEditorMessages.getString("QuickDiffConfigurationBlock.defaultlabel"), j); //$NON-NLS-1$//$NON-NLS-2$
- defaultIndex= j;
- } else
- fQuickDiffProviderList.add(fQuickDiffProviderListModel[j][1], j);
- }
- fSetDefaultButton.setEnabled(defaultIndex != i);
- fQuickDiffProviderList.setSelection(i);
- fQuickDiffProviderList.redraw();
- }
-
- public void initialize() {
-
- for (int i= 0; i < fQuickDiffProviderListModel.length; i++) {
- String label= fQuickDiffProviderListModel[i][1];
- if (fStore.getString(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER).equals(fQuickDiffProviderListModel[i][0]))
- label += " " + TextEditorMessages.getString("QuickDiffConfigurationBlock.defaultlabel"); //$NON-NLS-1$ //$NON-NLS-2$
- fQuickDiffProviderList.add(label);
- }
- fQuickDiffProviderList.getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (fQuickDiffProviderList != null && !fQuickDiffProviderList.isDisposed()) {
- fQuickDiffProviderList.select(0);
- handleProviderListSelection();
- }
- }
- });
-
- initializeFields();
- }
-
- private void initializeFields() {
- Iterator e= fCheckBoxes.keySet().iterator();
- while (e.hasNext()) {
- Button b= (Button) e.next();
- String key= (String) fCheckBoxes.get(b);
- b.setSelection(fStore.getBoolean(key));
- }
-
- updateQuickDiffControls();
- }
-
- public void performOk() {
- }
-
- public void performDefaults() {
- initializeFields();
- updateProviderList();
- }
-
- private void handleProviderListSelection() {
- int i= fQuickDiffProviderList.getSelectionIndex();
- if (i != -1) {
- boolean b= fStore.getString(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER).equals(fQuickDiffProviderListModel[i][0]);
- fSetDefaultButton.setEnabled(!b);
- }
- }
-
- private void updateQuickDiffControls() {
- boolean quickdiffOverviewRuler= false;
- for (int i= 0; i < fQuickDiffModel.length; i++) {
- fQuickDiffColorEditors[i].setColorValue(PreferenceConverter.getColor(fStore, fQuickDiffModel[i][0]));
- quickdiffOverviewRuler |= fStore.getBoolean(fQuickDiffModel[i][1]);
- }
- fQuickDiffOverviewRulerCheckBox.setSelection(quickdiffOverviewRuler);
- }
-
- /*
- * @see org.eclipse.ui.internal.editors.text.IPreferenceConfigurationBlock#dispose()
- * @since 3.0
- */
- public void dispose() {
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffPreferencePage.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffPreferencePage.java
deleted file mode 100644
index d5c5efca6..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffPreferencePage.java
+++ /dev/null
@@ -1,54 +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.ui.internal.editors.text;
-
-
-
-/**
- * Quick Diff preference page.
- * <p>
- * Note: Must be public since it is referenced from plugin.xml
- * </p>
- *
- * @since 3.0
- */
-public class QuickDiffPreferencePage extends AbstractConfigurationBlockPreferencePage {
-
- /*
- * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#getHelpId()
- */
- protected String getHelpId() {
- return null; // FIXME: Needs help context ID
- }
-
- /*
- * @see org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setDescription()
- */
- protected void setDescription() {
- String description= TextEditorMessages.getString("QuickDiffConfigurationBlock.description"); //$NON-NLS-1$
- setDescription(description);
- }
-
- /*
- * @see org.org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setPreferenceStore()
- */
- protected void setPreferenceStore() {
- setPreferenceStore(EditorsPlugin.getDefault().getPreferenceStore());
- }
-
- /*
- * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#createConfigurationBlock(org.eclipse.ui.internal.editors.text.OverlayPreferenceStore)
- */
- protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) {
- return new QuickDiffConfigurationBlock(overlayPreferenceStore);
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SharedTextColors.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SharedTextColors.java
deleted file mode 100644
index d9bfd6300..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SharedTextColors.java
+++ /dev/null
@@ -1,76 +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.ui.internal.editors.text;
-
-import java.util.Iterator;
-import org.eclipse.swt.widgets.Display;
-import java.util.Map;
-import java.util.HashMap;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.jface.text.source.ISharedTextColors;
-import org.eclipse.swt.graphics.RGB;
-
-/*
- * @see org.eclipse.jface.text.source.ISharedTextColors
- * @since 2.1
- */
-class SharedTextColors implements ISharedTextColors {
-
- /** The display table. */
- private Map fDisplayTable;
-
- /** Creates an returns a shared color manager. */
- public SharedTextColors() {
- super();
- }
-
- /*
- * @see ISharedTextColors#getColor(RGB)
- */
- public Color getColor(RGB rgb) {
- if (rgb == null)
- return null;
-
- if (fDisplayTable == null)
- fDisplayTable= new HashMap(2);
-
- Display display= Display.getCurrent();
-
- Map colorTable= (Map) fDisplayTable.get(display);
- if (colorTable == null) {
- colorTable= new HashMap(10);
- fDisplayTable.put(display, colorTable);
- }
-
- Color color= (Color) colorTable.get(rgb);
- if (color == null) {
- color= new Color(display, rgb);
- colorTable.put(rgb, color);
- }
-
- return color;
- }
-
- /*
- * @see ISharedTextColors#dispose()
- */
- public void dispose() {
- if (fDisplayTable != null) {
- Iterator j= fDisplayTable.values().iterator();
- while (j.hasNext()) {
- Iterator i= ((Map) j.next()).values().iterator();
- while (i.hasNext())
- ((Color) i.next()).dispose();
- }
- }
- }
-
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/StatusInfo.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/StatusInfo.java
deleted file mode 100644
index d9b7debe2..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/StatusInfo.java
+++ /dev/null
@@ -1,194 +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.ui.internal.editors.text;
-
-import org.eclipse.core.runtime.IStatus;
-
-import org.eclipse.jface.util.Assert;
-
-import org.eclipse.ui.editors.text.EditorsUI;
-
-/**
- * A settable IStatus.
- * Can be an error, warning, info or ok. For error, info and warning states,
- * a message describes the problem.
- *
- * @since 2.1
- */
-class StatusInfo implements IStatus {
-
- /** The message of this status. */
- private String fStatusMessage;
- /** The severity of this status. */
- private int fSeverity;
-
- /**
- * Creates a status set to OK (no message).
- */
- public StatusInfo() {
- this(OK, null);
- }
-
- /**
- * Creates a status with the given severity and message.
- *
- * @param severity the severity of this status: ERROR, WARNING, INFO and OK.
- * @param message the message of this status. Applies only for ERROR,
- * WARNING and INFO.
- */
- public StatusInfo(int severity, String message) {
- fStatusMessage= message;
- fSeverity= severity;
- }
-
- /*
- * @see org.eclipse.core.runtime.IStatus#isOK()
- */
- public boolean isOK() {
- return fSeverity == IStatus.OK;
- }
-
- /**
- * Returns whether this status indicates a warning.
- *
- * @return <code>true</code> if this status has severity
- * {@link IStatus#WARNING} and <code>false</code> otherwise
- */
- public boolean isWarning() {
- return fSeverity == IStatus.WARNING;
- }
-
- /**
- * Returns whether this status indicates an info.
- *
- * @return <code>true</code> if this status has severity
- * {@link IStatus#INFO} and <code>false</code> otherwise
- */
- public boolean isInfo() {
- return fSeverity == IStatus.INFO;
- }
-
- /**
- * Returns whether this status indicates an error.
- *
- * @return <code>true</code> if this status has severity
- * {@link IStatus#ERROR} and <code>false</code> otherwise
- */
- public boolean isError() {
- return fSeverity == IStatus.ERROR;
- }
-
- /*
- * @see IStatus#getMessage()
- */
- public String getMessage() {
- return fStatusMessage;
- }
-
- /**
- * Sets the status to ERROR.
- *
- * @param errorMessage the error message which can be an empty string, but not <code>null</code>
- */
- public void setError(String errorMessage) {
- Assert.isNotNull(errorMessage);
- fStatusMessage= errorMessage;
- fSeverity= IStatus.ERROR;
- }
-
- /**
- * Sets the status to WARNING.
- *
- * @param warningMessage the warning message which can be an empty string, but not <code>null</code>
- */
- public void setWarning(String warningMessage) {
- Assert.isNotNull(warningMessage);
- fStatusMessage= warningMessage;
- fSeverity= IStatus.WARNING;
- }
-
- /**
- * Sets the status to INFO.
- *
- * @param infoMessage the info message which can be an empty string, but not <code>null</code>
- */
- public void setInfo(String infoMessage) {
- Assert.isNotNull(infoMessage);
- fStatusMessage= infoMessage;
- fSeverity= IStatus.INFO;
- }
-
- /**
- * Sets the status to OK.
- */
- public void setOK() {
- fStatusMessage= null;
- fSeverity= IStatus.OK;
- }
-
- /*
- * @see IStatus#matches(int)
- */
- public boolean matches(int severityMask) {
- return (fSeverity & severityMask) != 0;
- }
-
- /**
- * Returns always <code>false</code>.
- *
- * @see IStatus#isMultiStatus()
- */
- public boolean isMultiStatus() {
- return false;
- }
-
- /*
- * @see IStatus#getSeverity()
- */
- public int getSeverity() {
- return fSeverity;
- }
-
- /*
- * @see IStatus#getPlugin()
- */
- public String getPlugin() {
- return EditorsUI.PLUGIN_ID;
- }
-
- /**
- * Returns always <code>null</code>.
- *
- * @see IStatus#getException()
- */
- public Throwable getException() {
- return null;
- }
-
- /**
- * Returns always the error severity.
- *
- * @see IStatus#getCode()
- */
- public int getCode() {
- return fSeverity;
- }
-
- /**
- * Returns always <code>null</code>.
- *
- * @see IStatus#getChildren()
- */
- public IStatus[] getChildren() {
- return new IStatus[0];
- }
-
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TabFolderLayout.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TabFolderLayout.java
deleted file mode 100644
index a09b26bb7..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TabFolderLayout.java
+++ /dev/null
@@ -1,66 +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.ui.internal.editors.text;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Layout;
-
-/**
- * This layout controls the position and size
- * of the children of a tab folder.
- *
- * @since 2.1
- */
-class TabFolderLayout extends Layout {
-
- /*
- * @see org.eclipse.swt.widgets.Layout#computeSize(org.eclipse.swt.widgets.Composite, int, int, boolean)
- */
- protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) {
- if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT)
- return new Point(wHint, hHint);
-
- Control [] children = composite.getChildren ();
- int count = children.length;
- int maxWidth = 0, maxHeight = 0;
- for (int i=0; i<count; i++) {
- Control child = children [i];
- Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache);
- maxWidth = Math.max (maxWidth, pt.x);
- maxHeight = Math.max (maxHeight, pt.y);
- }
-
- if (wHint != SWT.DEFAULT)
- maxWidth= wHint;
- if (hHint != SWT.DEFAULT)
- maxHeight= hHint;
-
- return new Point(maxWidth, maxHeight);
-
- }
-
- /*
- * @see org.eclipse.swt.widgets.Layout#layout(org.eclipse.swt.widgets.Composite, boolean)
- */
- protected void layout (Composite composite, boolean flushCache) {
- Rectangle rect= composite.getClientArea();
-
- Control[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- children[i].setBounds(rect);
- }
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java
deleted file mode 100644
index f017ee51a..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.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.ui.internal.editors.text;
-
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Helper class which wraps the specified resource bundle
- * and offers methods to access the bundle.
- *
- * @since 2.1
- */
-class TextEditorMessages {
-
- private static final String RESOURCE_BUNDLE= "org.eclipse.ui.internal.editors.text.TextEditorMessages";//$NON-NLS-1$
-
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
- private TextEditorMessages() {
- }
-
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- }
-
- public static ResourceBundle getResourceBundle() {
- return fgResourceBundle;
- }
-
- public static String getFormattedString(String key, String arg) {
- return getFormattedString(key, new String[] { arg });
- }
-
- public static String getFormattedString(String key, String[] args) {
- return MessageFormat.format(getString(key), args);
- }
-
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties
deleted file mode 100644
index 6487df534..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties
+++ /dev/null
@@ -1,67 +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
-###############################################################################
-
-EditorsPlugin.internal_error=Internal Error
-
-TextEditorPreferencePage.description=Text Editor settings:
-
-TextEditorPreferencePage.general=Appeara&nce
-TextEditorPreferencePage.displayedTabWidth=Displayed &tab width:
-TextEditorPreferencePage.printMarginColumn=&Print margin column:
-TextEditorPreferencePage.showOverviewRuler=Show overview &ruler
-TextEditorPreferencePage.showLineNumbers=Show lin&e numbers
-TextEditorPreferencePage.highlightCurrentLine=Hi&ghlight current line
-TextEditorPreferencePage.showPrintMargin=Sho&w print margin
-TextEditorPreferencePage.color=C&olor:
-TextEditorPreferencePage.appearanceOptions=Appearance co&lor options:
-TextEditorPreferencePage.lineNumberForegroundColor=Line number foreground
-TextEditorPreferencePage.currentLineHighlighColor=Current line highlight
-TextEditorPreferencePage.printMarginColor=Print margin
-TextEditorPreferencePage.accessibility.disableCustomCarets= Use c&ustom caret
-TextEditorPreferencePage.accessibility.wideCaret= Ena&ble thick caret
-
-TextEditorPreferencePage.selectionForegroundColor= Selection foreground color
-TextEditorPreferencePage.selectionBackgroundColor= Selection background color
-TextEditorPreferencePage.systemDefault=System De&fault
-
-TextEditorPreferencePage.empty_input=Empty input
-TextEditorPreferencePage.invalid_input=''{0}'' is not a valid input.
-
-QuickDiffConfigurationBlock.title= &Quick Diff
-QuickDiffConfigurationBlock.description= General Quick Diff settings.
-QuickDiffConfigurationBlock.referenceProviderTitle=Quick Diff reference &providers:
-QuickDiffConfigurationBlock.setDefault=&Make Default
-QuickDiffConfigurationBlock.defaultlabel= (default)
-QuickDiffConfigurationBlock.characterMode= &Use characters to show changes on line number bar
-QuickDiffConfigurationBlock.showForNewEditors=&Enable quick diff when opening a new editor
-QuickDiffConfigurationBlock.showInOverviewRuler= Show differences in &overview ruler
-QuickDiffConfigurationBlock.colorTitle=Colo&rs
-QuickDiffConfigurationBlock.changeColor= C&hanges:
-QuickDiffConfigurationBlock.additionColor= Addi&tions:
-QuickDiffConfigurationBlock.deletionColor= De&letions:
-
-OpenExternalFileAction.dialog.text=Open External File
-OpenExternalFileAction.FileNotFound={0}\nFile not found.
-OpenExternalFileAction.SelectWorkspaceFile=Select Workspace File
-OpenExternalFileAction.FileLinkedtoMultiple=The selected file is referenced by multiple linked resources in the workspace.\nSelect a workspace resource to open the file.
-
-AnnotationConfigurationBlock.description= General annotation settings.
-AnnotationConfigurationBlock.annotationPresentationOptions= Annotation &presentation:
-AnnotationConfigurationBlock.showInText= Show in &text
-AnnotationConfigurationBlock.NONE=None
-AnnotationConfigurationBlock.SQUIGGLES=Squiggles
-AnnotationConfigurationBlock.UNDERLINE=Underline
-AnnotationConfigurationBlock.BOX=Box
-AnnotationConfigurationBlock.IBEAM=IBeam
-AnnotationConfigurationBlock.highlightInText= &Highlight in text
-AnnotationConfigurationBlock.showInOverviewRuler= Show in overview &ruler
-AnnotationConfigurationBlock.showInVerticalRuler= Show in vertical r&uler
-AnnotationConfigurationBlock.color= C&olor:
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorPreferencePage2.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorPreferencePage2.java
deleted file mode 100644
index 3cd87aa7d..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorPreferencePage2.java
+++ /dev/null
@@ -1,550 +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.ui.internal.editors.text;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IStatus;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Text;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.DialogPage;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.preference.PreferencePage;
-
-import org.eclipse.ui.editors.text.ITextEditorHelpContextIds;
-
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.WorkbenchHelp;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-
-
-
-/**
- * The preference page for setting the editor options.
- * <p>
- * This class is internal and not intended to be used by clients.</p>
- *
- * @since 2.1
- */
-public class TextEditorPreferencePage2 extends PreferencePage implements IWorkbenchPreferencePage {
-
- private final String[][] fAppearanceColorListModel= new String[][] {
- {TextEditorMessages.getString("TextEditorPreferencePage.lineNumberForegroundColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR, null}, //$NON-NLS-1$
- {TextEditorMessages.getString("TextEditorPreferencePage.currentLineHighlighColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR, null}, //$NON-NLS-1$
- {TextEditorMessages.getString("TextEditorPreferencePage.printMarginColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR, null}, //$NON-NLS-1$
- {TextEditorMessages.getString("TextEditorPreferencePage.selectionForegroundColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR}, //$NON-NLS-1$
- {TextEditorMessages.getString("TextEditorPreferencePage.selectionBackgroundColor"), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR}, //$NON-NLS-1$
- };
-
- private OverlayPreferenceStore fOverlayStore;
-
- private Map fCheckBoxes= new HashMap();
- private SelectionListener fCheckBoxListener= new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- public void widgetSelected(SelectionEvent e) {
- Button button= (Button) e.widget;
- fOverlayStore.setValue((String) fCheckBoxes.get(button), button.getSelection());
- }
- };
-
- private Map fTextFields= new HashMap();
- private ModifyListener fTextFieldListener= new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- Text text= (Text) e.widget;
- fOverlayStore.setValue((String) fTextFields.get(text), text.getText());
- }
- };
-
- private ArrayList fNumberFields= new ArrayList();
- private ModifyListener fNumberFieldListener= new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- numberFieldChanged((Text) e.widget);
- }
- };
-
- private List fAppearanceColorList;
- private ColorEditor fAppearanceColorEditor;
- private Button fAppearanceColorDefault;
-
- /**
- * Tells whether the fields are initialized.
- * @since 3.0
- */
- private boolean fFieldsInitialized= false;
-
- /**
- * List of master/slave listeners when there's a dependency.
- *
- * @see #createDependency(Button, String, Control)
- * @since 3.0
- */
- private ArrayList fMasterSlaveListeners= new ArrayList();
-
-
- public TextEditorPreferencePage2() {
- setDescription(TextEditorMessages.getString("TextEditorPreferencePage.description")); //$NON-NLS-1$
- setPreferenceStore(EditorsPlugin.getDefault().getPreferenceStore());
-
- fOverlayStore= createOverlayStore();
- }
-
- private OverlayPreferenceStore createOverlayStore() {
-
- ArrayList overlayKeys= new ArrayList();
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE));
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH));
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN));
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER));
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_CUSTOM_CARETS));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_WIDE_CARET));
-
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR));
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR));
-
- OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
- overlayKeys.toArray(keys);
- return new OverlayPreferenceStore(getPreferenceStore(), keys);
- }
-
- /*
- * @see IWorkbenchPreferencePage#init()
- */
- public void init(IWorkbench workbench) {
- }
-
- /*
- * @see PreferencePage#createControl(Composite)
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- WorkbenchHelp.setHelp(getControl(), ITextEditorHelpContextIds.TEXT_EDITOR_PREFERENCE_PAGE);
- }
-
- private void handleAppearanceColorListSelection() {
- int i= fAppearanceColorList.getSelectionIndex();
- String key= fAppearanceColorListModel[i][1];
- RGB rgb= PreferenceConverter.getColor(fOverlayStore, key);
- fAppearanceColorEditor.setColorValue(rgb);
- updateAppearanceColorWidgets(fAppearanceColorListModel[i][2]);
- }
-
- private void updateAppearanceColorWidgets(String systemDefaultKey) {
- if (systemDefaultKey == null) {
- fAppearanceColorDefault.setSelection(false);
- fAppearanceColorDefault.setVisible(false);
- fAppearanceColorEditor.getButton().setEnabled(true);
- } else {
- boolean systemDefault= fOverlayStore.getBoolean(systemDefaultKey);
- fAppearanceColorDefault.setSelection(systemDefault);
- fAppearanceColorDefault.setVisible(true);
- fAppearanceColorEditor.getButton().setEnabled(!systemDefault);
- }
- }
-
- private Control createAppearancePage(Composite parent) {
-
- Composite appearanceComposite= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout(); layout.numColumns= 2;
- appearanceComposite.setLayout(layout);
-
- String label= TextEditorMessages.getString("TextEditorPreferencePage.displayedTabWidth"); //$NON-NLS-1$
- addTextField(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH, 3, 0, true);
-
- label= TextEditorMessages.getString("TextEditorPreferencePage.printMarginColumn"); //$NON-NLS-1$
- addTextField(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 3, 0, true);
-
- label= TextEditorMessages.getString("TextEditorPreferencePage.showOverviewRuler"); //$NON-NLS-1$
- addCheckBox(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER, 0);
-
- label= TextEditorMessages.getString("TextEditorPreferencePage.showLineNumbers"); //$NON-NLS-1$
- addCheckBox(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER, 0);
-
- label= TextEditorMessages.getString("TextEditorPreferencePage.highlightCurrentLine"); //$NON-NLS-1$
- addCheckBox(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE, 0);
-
- label= TextEditorMessages.getString("TextEditorPreferencePage.showPrintMargin"); //$NON-NLS-1$
- addCheckBox(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, 0);
-
- label= TextEditorMessages.getString("TextEditorPreferencePage.accessibility.disableCustomCarets"); //$NON-NLS-1$
- Button master= addCheckBox(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_CUSTOM_CARETS, 0);
-
- label= TextEditorMessages.getString("TextEditorPreferencePage.accessibility.wideCaret"); //$NON-NLS-1$
- Button slave= addCheckBox(appearanceComposite, label, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_WIDE_CARET, 0);
- createDependency(master, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_CUSTOM_CARETS, slave);
-
- Label l= new Label(appearanceComposite, SWT.LEFT );
- GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan= 2;
- gd.heightHint= convertHeightInCharsToPixels(1) / 2;
- l.setLayoutData(gd);
-
- l= new Label(appearanceComposite, SWT.LEFT);
- l.setText(TextEditorMessages.getString("TextEditorPreferencePage.appearanceOptions")); //$NON-NLS-1$
- gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan= 2;
- l.setLayoutData(gd);
-
- Composite editorComposite= new Composite(appearanceComposite, SWT.NONE);
- layout= new GridLayout();
- layout.numColumns= 2;
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- editorComposite.setLayout(layout);
- gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
- gd.horizontalSpan= 2;
- editorComposite.setLayoutData(gd);
-
- fAppearanceColorList= new List(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER);
- gd= new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
- gd.heightHint= convertHeightInCharsToPixels(5);
- fAppearanceColorList.setLayoutData(gd);
-
- Composite stylesComposite= new Composite(editorComposite, SWT.NONE);
- layout= new GridLayout();
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.numColumns= 2;
- stylesComposite.setLayout(layout);
- stylesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- l= new Label(stylesComposite, SWT.LEFT);
- l.setText(TextEditorMessages.getString("TextEditorPreferencePage.color")); //$NON-NLS-1$
- gd= new GridData();
- gd.horizontalAlignment= GridData.BEGINNING;
- l.setLayoutData(gd);
-
- fAppearanceColorEditor= new ColorEditor(stylesComposite);
- Button foregroundColorButton= fAppearanceColorEditor.getButton();
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment= GridData.BEGINNING;
- foregroundColorButton.setLayoutData(gd);
-
- SelectionListener colorDefaultSelectionListener= new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- boolean systemDefault= fAppearanceColorDefault.getSelection();
- fAppearanceColorEditor.getButton().setEnabled(!systemDefault);
-
- int i= fAppearanceColorList.getSelectionIndex();
- String key= fAppearanceColorListModel[i][2];
- if (key != null)
- fOverlayStore.setValue(key, systemDefault);
- }
- public void widgetDefaultSelected(SelectionEvent e) {}
- };
-
- fAppearanceColorDefault= new Button(stylesComposite, SWT.CHECK);
- fAppearanceColorDefault.setText(TextEditorMessages.getString("TextEditorPreferencePage.systemDefault")); //$NON-NLS-1$
- gd= new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment= GridData.BEGINNING;
- gd.horizontalSpan= 2;
- fAppearanceColorDefault.setLayoutData(gd);
- fAppearanceColorDefault.setVisible(false);
- fAppearanceColorDefault.addSelectionListener(colorDefaultSelectionListener);
-
- fAppearanceColorList.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
- public void widgetSelected(SelectionEvent e) {
- handleAppearanceColorListSelection();
- }
- });
- foregroundColorButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
- // do nothing
- }
- public void widgetSelected(SelectionEvent e) {
- int i= fAppearanceColorList.getSelectionIndex();
- String key= fAppearanceColorListModel[i][1];
-
- PreferenceConverter.setValue(fOverlayStore, key, fAppearanceColorEditor.getColorValue());
- }
- });
-
- return appearanceComposite;
- }
-
- /*
- * @see PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
-
- initializeDefaultColors();
-
- fOverlayStore.load();
- fOverlayStore.start();
-
- Control control= createAppearancePage(parent);
-
- initialize();
- Dialog.applyDialogFont(control);
- return control;
- }
-
- private void initialize() {
-
- initializeFields();
-
- for (int i= 0; i < fAppearanceColorListModel.length; i++)
- fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
- fAppearanceColorList.getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) {
- fAppearanceColorList.select(0);
- handleAppearanceColorListSelection();
- }
- }
- });
- }
-
- private void initializeFields() {
-
- Iterator e= fCheckBoxes.keySet().iterator();
- while (e.hasNext()) {
- Button b= (Button) e.next();
- String key= (String) fCheckBoxes.get(b);
- b.setSelection(fOverlayStore.getBoolean(key));
- }
-
- e= fTextFields.keySet().iterator();
- while (e.hasNext()) {
- Text t= (Text) e.next();
- String key= (String) fTextFields.get(t);
- t.setText(fOverlayStore.getString(key));
- }
-
- fFieldsInitialized= true;
- updateStatus(validatePositiveNumber("0")); //$NON-NLS-1$
-
- // Update slaves
- Iterator iter= fMasterSlaveListeners.iterator();
- while (iter.hasNext()) {
- SelectionListener listener= (SelectionListener)iter.next();
- listener.widgetSelected(null);
- }
- }
-
- private void initializeDefaultColors() {
- if (!getPreferenceStore().contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR)) {
- RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION).getRGB();
- PreferenceConverter.setDefault(fOverlayStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, rgb);
- PreferenceConverter.setDefault(getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, rgb);
- }
- if (!getPreferenceStore().contains(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR)) {
- RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT).getRGB();
- PreferenceConverter.setDefault(fOverlayStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, rgb);
- PreferenceConverter.setDefault(getPreferenceStore(), AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, rgb);
- }
- }
-
- /*
- * @see PreferencePage#performOk()
- */
- public boolean performOk() {
- fOverlayStore.propagate();
- EditorsPlugin.getDefault().savePluginPreferences();
- return true;
- }
-
- /*
- * @see PreferencePage#performDefaults()
- */
- protected void performDefaults() {
-
- fOverlayStore.loadDefaults();
-
- initializeFields();
-
- handleAppearanceColorListSelection();
-
- super.performDefaults();
- }
-
- /*
- * @see DialogPage#dispose()
- */
- public void dispose() {
-
- if (fOverlayStore != null) {
- fOverlayStore.stop();
- fOverlayStore= null;
- }
-
- super.dispose();
- }
-
- private Button addCheckBox(Composite parent, String label, String key, int indentation) {
- Button checkBox= new Button(parent, SWT.CHECK);
- checkBox.setText(label);
-
- GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalIndent= indentation;
- gd.horizontalSpan= 2;
- checkBox.setLayoutData(gd);
- checkBox.addSelectionListener(fCheckBoxListener);
-
- fCheckBoxes.put(checkBox, key);
-
- return checkBox;
- }
-
- private Control addTextField(Composite composite, String label, String key, int textLimit, int indentation, boolean isNumber) {
-
- Label labelControl= new Label(composite, SWT.NONE);
- labelControl.setText(label);
- GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalIndent= indentation;
- labelControl.setLayoutData(gd);
-
- Text textControl= new Text(composite, SWT.BORDER | SWT.SINGLE);
- gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.widthHint= convertWidthInCharsToPixels(textLimit + 1);
- textControl.setLayoutData(gd);
- textControl.setTextLimit(textLimit);
- fTextFields.put(textControl, key);
- if (isNumber) {
- fNumberFields.add(textControl);
- textControl.addModifyListener(fNumberFieldListener);
- } else {
- textControl.addModifyListener(fTextFieldListener);
- }
-
- return textControl;
- }
-
- private void createDependency(final Button master, String masterKey, final Control slave) {
- indent(slave);
-
- boolean masterState= fOverlayStore.getBoolean(masterKey);
- slave.setEnabled(masterState);
-
- SelectionListener listener= new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- slave.setEnabled(master.getSelection());
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {}
- };
- master.addSelectionListener(listener);
- fMasterSlaveListeners.add(listener);
- }
-
- private static void indent(Control control) {
- GridData gridData= new GridData();
- gridData.horizontalIndent= 20;
- control.setLayoutData(gridData);
- }
-
- private void numberFieldChanged(Text textControl) {
- String number= textControl.getText();
- IStatus status= validatePositiveNumber(number);
- if (!status.matches(IStatus.ERROR))
- fOverlayStore.setValue((String) fTextFields.get(textControl), number);
- updateStatus(status);
- }
-
- private IStatus validatePositiveNumber(String number) {
- StatusInfo status= new StatusInfo();
- if (number.length() == 0) {
- status.setError(TextEditorMessages.getString("TextEditorPreferencePage.empty_input")); //$NON-NLS-1$
- } else {
- try {
- int value= Integer.parseInt(number);
- if (value < 0)
- status.setError(TextEditorMessages.getFormattedString("TextEditorPreferencePage.invalid_input", number)); //$NON-NLS-1$
- } catch (NumberFormatException e) {
- status.setError(TextEditorMessages.getFormattedString("TextEditorPreferencePage.invalid_input", number)); //$NON-NLS-1$
- }
- }
- return status;
- }
-
- void updateStatus(IStatus status) {
- if (!fFieldsInitialized)
- return;
-
- if (!status.matches(IStatus.ERROR)) {
- for (int i= 0; i < fNumberFields.size(); i++) {
- Text text= (Text) fNumberFields.get(i);
- IStatus s= validatePositiveNumber(text.getText());
- status= s.getSeverity() > status.getSeverity() ? s : status;
- }
- }
- setValid(!status.matches(IStatus.ERROR));
- applyToStatusLine(this, status);
- }
-
- /**
- * Applies the status to the status line of a dialog page.
- *
- * @param page the dialog page
- * @param status the status
- */
- public void applyToStatusLine(DialogPage page, IStatus status) {
- String message= status.getMessage();
- switch (status.getSeverity()) {
- case IStatus.OK:
- page.setMessage(message, IMessageProvider.NONE);
- page.setErrorMessage(null);
- break;
- case IStatus.WARNING:
- page.setMessage(message, IMessageProvider.WARNING);
- page.setErrorMessage(null);
- break;
- case IStatus.INFO:
- page.setMessage(message, IMessageProvider.INFORMATION);
- page.setErrorMessage(null);
- break;
- default:
- if (message.length() == 0) {
- message= null;
- }
- page.setMessage(null);
- page.setErrorMessage(message);
- break;
- }
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UISynchronizationContext.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UISynchronizationContext.java
deleted file mode 100644
index 815a7d6ba..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/UISynchronizationContext.java
+++ /dev/null
@@ -1,42 +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.ui.internal.editors.text;
-
-import org.eclipse.core.filebuffers.ISynchronizationContext;
-
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Synchronization context for file buffers whose documents are shown in the UI.
- * The synchronization runnable is executed in the UI thread.
- *
- * @since 3.0
- */
-public class UISynchronizationContext implements ISynchronizationContext {
-
- /*
- * @see org.eclipse.core.filebuffers.ISynchronizationContext#run(java.lang.Runnable)
- */
- public void run(Runnable runnable) {
- IWorkbench workbench= PlatformUI.getWorkbench();
- IWorkbenchWindow[] windows= workbench.getWorkbenchWindows();
- if (windows != null && windows.length > 0) {
- Display display= windows[0].getShell().getDisplay();
- display.asyncExec(runnable);
- } else {
- runnable.run();
- }
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/WorkspaceOperationRunner.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/WorkspaceOperationRunner.java
deleted file mode 100644
index 28176fcd3..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/WorkspaceOperationRunner.java
+++ /dev/null
@@ -1,75 +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.ui.internal.editors.text;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-
-import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
-import org.eclipse.ui.texteditor.ISchedulingRuleProvider;
-
-/**
- * @since 3.0
- */
-public class WorkspaceOperationRunner implements IRunnableContext {
-
- private IProgressMonitor fProgressMonitor;
-
- public WorkspaceOperationRunner() {
- }
-
- /**
- * Sets the progress monitor.
- *
- * @param progressMonitor the progress monitor to set
- */
- public void setProgressMonitor(IProgressMonitor progressMonitor) {
- fProgressMonitor= progressMonitor;
- }
-
- /**
- * Returns the progress monitor. It there is no progress monitor the monitor\
- * is set to the <code>NullProgressMonitor</code>.
- *
- * @return the progress monitor
- */
- public IProgressMonitor getProgressMonitor() {
- if (fProgressMonitor == null)
- fProgressMonitor= new NullProgressMonitor();
- return fProgressMonitor;
- }
-
- /*
- * @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
- */
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
- if (runnable instanceof ISchedulingRuleProvider)
- run(fork, cancelable, runnable, ((ISchedulingRuleProvider)runnable).getSchedulingRule());
- else
- run(fork, cancelable, runnable, ResourcesPlugin.getWorkspace().getRoot());
- }
-
- /*
- * @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
- */
- public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable, ISchedulingRule schedulingRule) throws InvocationTargetException, InterruptedException {
- WorkspaceModifyDelegatingOperation operation= new WorkspaceModifyDelegatingOperation(runnable, schedulingRule);
- operation.run(getProgressMonitor());
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationType.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationType.java
deleted file mode 100644
index 33ab9dd93..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationType.java
+++ /dev/null
@@ -1,70 +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.ui.internal.texteditor;
-
-import org.eclipse.ui.texteditor.AnnotationPreference;
-
-/**
- * Represents an annotation type.
- *
- * @since 3.0
- */
-public final class AnnotationType {
- private String fType;
- private String[] fSuperTypes;
- private AnnotationPreference fPreference;
-
- public AnnotationType(String type, String[] superTypes) {
- fType= type;
- fSuperTypes= superTypes;
- }
-
- public String getType() {
- return fType;
- }
-
- public String[] getSuperTypes() {
- return fSuperTypes;
- }
-
- /**
- * For internal use only.
- *
- * @return the annotation preference
- */
- public AnnotationPreference getPreference() {
- return fPreference;
- }
-
- /**
- * For internal use only.
- *
- * @param preference the annotation preference
- */
- public void setAnnotationPreference(AnnotationPreference preference) {
- fPreference= preference;
- }
-
- public boolean isSubtype(String superType) {
- if (fSuperTypes == null || superType == null)
- return false;
-
- if (superType.equals(fType))
- return true;
-
- for (int i= fSuperTypes.length -1; i > -1; i--) {
- if (superType.equals(fSuperTypes[i]))
- return true;
- }
-
- return false;
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationTypeHierarchy.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationTypeHierarchy.java
deleted file mode 100644
index 44976bf09..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/AnnotationTypeHierarchy.java
+++ /dev/null
@@ -1,109 +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.ui.internal.texteditor;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.ui.editors.text.EditorsUI;
-
-
-/**
- * Internal annotation super type hierarchy cache.
- * TODO this cache is currently unbound, i.e. only limited by the number of annotation types
- *
- * @since 3.0
- */
-public final class AnnotationTypeHierarchy {
-
- private Map fTypeMap;
- private Map fTypesCache= new HashMap();
-
- public AnnotationTypeHierarchy() {
- }
-
- public AnnotationType getAnnotationType(String typeName) {
- AnnotationType type= (AnnotationType) fTypesCache.get(typeName);
- if (type == null) {
- String[] superTypes= computeSuperTypes(typeName);
- type= new AnnotationType(typeName, superTypes);
- fTypesCache.put(typeName, type);
- }
- return type;
- }
-
- public boolean isSubtype(String superType, String subtypeCandidate) {
- AnnotationType type= getAnnotationType(subtypeCandidate);
- return type.isSubtype(superType);
- }
-
- private String[] computeSuperTypes(String typeName) {
- ArrayList types= new ArrayList();
- append(types, getDirectSuperType(typeName));
- int index= 0;
- while (index < types.size()) {
- String type= (String) types.get(index++);
- append(types, getDirectSuperType(type));
- }
-
- String[] superTypes= new String[types.size()];
- types.toArray(superTypes);
- return superTypes;
- }
-
- private String getDirectSuperType(String typeName) {
- return (String) getTypeMap().get(typeName);
- }
-
- private void append(List list, String string) {
- if (string == null || string.trim().length() == 0)
- return;
-
- if (!list.contains(string))
- list.add(string);
- }
-
- private Map getTypeMap() {
- if (fTypeMap == null)
- fTypeMap= readTypes();
- return fTypeMap;
- }
-
- private Map readTypes() {
- HashMap allTypes= new HashMap();
-
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(EditorsUI.PLUGIN_ID, "annotationTypes"); //$NON-NLS-1$
- if (extensionPoint != null) {
- IConfigurationElement[] elements= extensionPoint.getConfigurationElements();
- for (int i= 0; i < elements.length; i++) {
- IConfigurationElement element= elements[i];
-
- String name= element.getAttribute("name"); //$NON-NLS-1$
- if (name == null || name.trim().length() == 0)
- continue;
-
- String parent= element.getAttribute("super"); //$NON-NLS-1$
- if (parent == null || parent.trim().length() == 0)
- parent= ""; //$NON-NLS-1$
-
- allTypes.put(name, parent);
- }
- }
-
- return allTypes;
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/DelegatingAnnotationPreference.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/DelegatingAnnotationPreference.java
deleted file mode 100644
index c0b91e628..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/DelegatingAnnotationPreference.java
+++ /dev/null
@@ -1,251 +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.ui.internal.texteditor;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.swt.graphics.RGB;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-import org.eclipse.jface.text.source.IAnnotationAccessExtension;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.AnnotationPreferenceLookup;
-import org.eclipse.ui.texteditor.IAnnotationImageProvider;
-
-
-public class DelegatingAnnotationPreference extends AnnotationPreference {
-
- private AnnotationType fType;
- private AnnotationPreferenceLookup fLookup;
- private Set fCache= new HashSet();
-
- public DelegatingAnnotationPreference(AnnotationType type, AnnotationPreferenceLookup lookup) {
- fType= type;
- fLookup= lookup;
- }
-
- private boolean isCached(Object attribute) {
- return fCache.contains(attribute);
- }
-
- private void markCached(Object attribute) {
- fCache.add(attribute);
- }
-
- private AnnotationPreference getDefiningPreference(Object attribute) {
-
- AnnotationPreference p= fLookup.getAnnotationPreferenceFragment(fType.getType());
- if (p != null && p.hasValue(attribute))
- return p;
-
- String[] superTypes= fType.getSuperTypes();
- for (int i= 0; i < superTypes.length; i++) {
- p= fLookup.getAnnotationPreferenceFragment(superTypes[i]);
- if (p != null && p.hasValue(attribute))
- return p;
- }
-
- return null;
- }
-
- private Object getAttributeValue(Object attribute) {
- if (!isCached(attribute)) {
- AnnotationPreference preference= getDefiningPreference(attribute);
- if (preference != null)
- setValue(attribute, preference.getValue(attribute));
- markCached(attribute);
- }
- return getValue(attribute);
- }
-
- private boolean getBooleanAttributeValue(Object attribute) {
- Object value= getAttributeValue(attribute);
- if (value instanceof Boolean)
- return ((Boolean) value).booleanValue();
- return false;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getAnnotationType()
- */
- public Object getAnnotationType() {
- return fType.getType();
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#contributesToHeader()
- */
- public boolean contributesToHeader() {
- return getBooleanAttributeValue(HEADER_VALUE);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getAnnotationImageProvider()
- */
- public IAnnotationImageProvider getAnnotationImageProvider() {
- if (!isCached(IMAGE_PROVIDER)) {
- AnnotationPreference preference= getDefiningPreference(IMAGE_PROVIDER);
- if (preference != null) {
- fAnnotationImageProvider= preference.fAnnotationImageProvider;
- fAnnotationImageProviderAttribute= preference.fAnnotationImageProviderAttribute;
- fConfigurationElement= preference.fConfigurationElement;
- }
- markCached(IMAGE_PROVIDER);
- }
- return super.getAnnotationImageProvider();
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getColorPreferenceKey()
- */
- public String getColorPreferenceKey() {
- return (String) getAttributeValue(COLOR_PREFERENCE_KEY);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getColorPreferenceValue()
- */
- public RGB getColorPreferenceValue() {
- return (RGB) getAttributeValue(COLOR_PREFERENCE_VALUE);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getHighlightPreferenceKey()
- */
- public String getHighlightPreferenceKey() {
- return (String) getAttributeValue(HIGHLIGHT_PREFERENCE_KEY);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getHighlightPreferenceValue()
- */
- public boolean getHighlightPreferenceValue() {
- return getBooleanAttributeValue(HIGHLIGHT_PREFERENCE_VALUE);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getImageDescriptor()
- */
- public ImageDescriptor getImageDescriptor() {
- return (ImageDescriptor) getAttributeValue(IMAGE_DESCRIPTOR);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getIsGoToNextNavigationTargetKey()
- */
- public String getIsGoToNextNavigationTargetKey() {
- return (String) getAttributeValue(IS_GO_TO_NEXT_TARGET_KEY);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getIsGoToPreviousNavigationTargetKey()
- */
- public String getIsGoToPreviousNavigationTargetKey() {
- return (String) getAttributeValue(IS_GO_TO_PREVIOUS_TARGET_KEY);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getOverviewRulerPreferenceKey()
- */
- public String getOverviewRulerPreferenceKey() {
- return (String) getAttributeValue(OVERVIEW_RULER_PREFERENCE_KEY);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getOverviewRulerPreferenceValue()
- */
- public boolean getOverviewRulerPreferenceValue() {
- return getBooleanAttributeValue(OVERVIEW_RULER_PREFERENCE_VALUE);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getPreferenceLabel()
- */
- public String getPreferenceLabel() {
- return (String) getAttributeValue(PREFERENCE_LABEL);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getPresentationLayer()
- */
- public int getPresentationLayer() {
- Object value= getAttributeValue(PRESENTATION_LAYER);
- if (value instanceof Integer)
- return ((Integer) value).intValue();
- return IAnnotationAccessExtension.DEFAULT_LAYER;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getShowInNextPrevDropdownToolbarActionKey()
- */
- public String getShowInNextPrevDropdownToolbarActionKey() {
- return (String) getAttributeValue(SHOW_IN_NAVIGATION_DROPDOWN_KEY);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getSymbolicImageName()
- */
- public String getSymbolicImageName() {
- return (String) getAttributeValue(SYMBOLIC_IMAGE_NAME);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getTextPreferenceKey()
- */
- public String getTextPreferenceKey() {
- return (String) getAttributeValue(TEXT_PREFERENCE_KEY);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getTextPreferenceValue()
- */
- public boolean getTextPreferenceValue() {
- return getBooleanAttributeValue(TEXT_PREFERENCE_VALUE);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getVerticalRulerPreferenceKey()
- */
- public String getVerticalRulerPreferenceKey() {
- return (String) getAttributeValue(VERTICAL_RULER_PREFERENCE_KEY);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#getVerticalRulerPreferenceValue()
- */
- public boolean getVerticalRulerPreferenceValue() {
- return getBooleanAttributeValue(VERTICAL_RULER_PREFERENCE_VALUE);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#isGoToNextNavigationTarget()
- */
- public boolean isGoToNextNavigationTarget() {
- return getBooleanAttributeValue(IS_GO_TO_NEXT_TARGET_VALUE);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#isGoToPreviousNavigationTarget()
- */
- public boolean isGoToPreviousNavigationTarget() {
- return getBooleanAttributeValue(IS_GO_TO_PREVIOUS_TARGET_VALUE);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AnnotationPreference#isShowInNextPrevDropdownToolbarAction()
- */
- public boolean isShowInNextPrevDropdownToolbarAction() {
- return getBooleanAttributeValue(SHOW_IN_NAVIGATION_DROPDOWN_VALUE);
- }
-
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java
deleted file mode 100644
index be324115b..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java
+++ /dev/null
@@ -1,367 +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.ui.internal.texteditor;
-
-import java.util.Arrays;
-
-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.ui.editors.text.TextSourceViewerConfiguration;
-
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-
-/**
- * Source viewer based implementation of <code>IInformationControl</code>.
- * Displays information in a source viewer configured with the text editor
- * preference store.
- *
- * @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;
- /** The horizontal scroll index. */
- private int fHorizontalScrollPixel;
-
- /**
- * 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 TextSourceViewerConfiguration(EditorsPlugin.getDefault().getPreferenceStore()));
- 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;
- }
-
- String spaces= getSpacesForHorizontalScrolling();
-
- IDocument doc= new Document(content + spaces);
- fViewer.setInput(doc);
- fViewer.getTextWidget().setHorizontalPixel(fHorizontalScrollPixel);
- }
-
- /**
- * Returns a run of spaces the length of which is at least
- * <code>fHorizontalScrollPixel</code>.
- *
- * @return the spaces to add to the document content to ensure that it can
- * be scrolled at least <code>fHorizontalScrollPixel</code>
- */
- private String getSpacesForHorizontalScrolling() {
- char[] spaces= new char[300];
- Arrays.fill(spaces, ' ');
- return new String(spaces);
- }
-
- /*
- * @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;
- }
-
- /**
- * @param scrollIndex the new horizontal scroll index.
- */
- void setHorizontalScrollPixel(int scrollIndex) {
- scrollIndex= Math.max(0, scrollIndex);
- fHorizontalScrollPixel= scrollIndex;
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/TextChangeHover.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/TextChangeHover.java
deleted file mode 100644
index ef15190a2..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/TextChangeHover.java
+++ /dev/null
@@ -1,63 +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.ui.internal.texteditor;
-
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.resource.JFaceResources;
-
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.source.ILineRange;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.LineChangeHover;
-
-
-
-/**
- * Change hover for text editors. Respects tab settings and text editor font.
- *
- * @since 3.0
- */
-public class TextChangeHover extends LineChangeHover {
-
- /** The last created information control. */
- private int fLastScrollIndex= 0;
-
- /*
- * @see org.eclipse.jface.text.source.LineChangeHover#getTabReplacement()
- */
- protected String getTabReplacement() {
- return Character.toString('\t');
- }
-
-
- /*
- * @see org.eclipse.jface.text.source.LineChangeHover#getHoverInfo(org.eclipse.jface.text.source.ISourceViewer, org.eclipse.jface.text.source.ILineRange, int)
- */
- public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleLines) {
- fLastScrollIndex= sourceViewer.getTextWidget().getHorizontalPixel();
- return super.getHoverInfo(sourceViewer, lineRange, visibleLines);
- }
-
- /*
- * @see org.eclipse.jface.text.source.IAnnotationHoverExtension#getHoverControlCreator()
- */
- public IInformationControlCreator getHoverControlCreator() {
- return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- SourceViewerInformationControl control= new SourceViewerInformationControl(parent, JFaceResources.TEXT_FONT);
- control.setHorizontalScrollPixel(fLastScrollIndex);
- return control;
- }
- };
- }
-}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
deleted file mode 100644
index 999861f30..000000000
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java
+++ /dev/null
@@ -1,1078 +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.ui.texteditor;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Composite;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.util.PropertyChangeEvent;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.AnnotationRulerColumn;
-import org.eclipse.jface.text.source.ChangeRulerColumn;
-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;
-import org.eclipse.jface.text.source.IChangeRulerColumn;
-import org.eclipse.jface.text.source.IOverviewRuler;
-import org.eclipse.jface.text.source.ISharedTextColors;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.ISourceViewerExtension;
-import org.eclipse.jface.text.source.IVerticalRuler;
-import org.eclipse.jface.text.source.IVerticalRulerColumn;
-import org.eclipse.jface.text.source.LineChangeHover;
-import org.eclipse.jface.text.source.LineNumberChangeRulerColumn;
-import org.eclipse.jface.text.source.LineNumberRulerColumn;
-import org.eclipse.jface.text.source.OverviewRuler;
-import org.eclipse.jface.text.source.SourceViewer;
-
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.editors.text.ForwardingDocumentProvider;
-import org.eclipse.ui.editors.text.ITextEditorHelpContextIds;
-import org.eclipse.ui.ide.IDEActionFactory;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.texteditor.quickdiff.QuickDiff;
-
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-import org.eclipse.ui.internal.texteditor.TextChangeHover;
-import org.eclipse.ui.internal.texteditor.quickdiff.DocumentLineDiffer;
-
-/**
- * An intermediate editor comprising functionality not present in the leaner <code>AbstractTextEditor</code>,
- * but used in many heavy weight (and especially source editing) editors, such as line numbers,
- * change ruler, overview ruler, print margins, current line highlighting, etc.
- *
- * @since 3.0
- */
-public abstract class AbstractDecoratedTextEditor extends StatusTextEditor {
- /**
- * Preference key for showing the line number ruler.
- */
- private final static String LINE_NUMBER_RULER= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER;
- /**
- * Preference key for the foreground color of the line numbers.
- */
- private final static String LINE_NUMBER_COLOR= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_LINE_NUMBER_RULER_COLOR;
- /**
- * Preference key for showing the overview ruler.
- */
- private final static String OVERVIEW_RULER= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER;
- /**
- * Preference key for highlighting current line.
- */
- private final static String CURRENT_LINE= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE;
- /**
- * Preference key for highlight color of current line.
- */
- private final static String CURRENT_LINE_COLOR= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR;
- /**
- * Preference key for showing print margin ruler.
- */
- private final static String PRINT_MARGIN= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN;
- /**
- * Preference key for print margin ruler color.
- */
- private final static String PRINT_MARGIN_COLOR= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLOR;
- /**
- * Preference key for print margin ruler column.
- */
- private final static String PRINT_MARGIN_COLUMN= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN;
-
- /**
- * Adapter class for <code>IGotoMarker</code>.
- */
- private class GotoMarkerAdapter implements IGotoMarker {
- public void gotoMarker(IMarker marker) {
- AbstractDecoratedTextEditor.this.gotoMarker(marker);
- }
- }
-
- /**
- * The annotation preferences.
- */
- private MarkerAnnotationPreferences fAnnotationPreferences;
- /**
- * The overview ruler of this editor.
- *
- * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API
- * compatibility reasons and will be made <code>private</code> soon. Use
- * {@link #getOverviewRuler()} instead.</p>
- */
- protected IOverviewRuler fOverviewRuler;
- /**
- * Helper for accessing annotation from the perspective of this editor.
- *
- * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API
- * compatibility reasons and will be made <code>private</code> soon. Use
- * {@link #getAnnotationAccess()} instead.</p>
- */
- protected IAnnotationAccess fAnnotationAccess;
- /**
- * Helper for managing the decoration support of this editor's viewer.
- *
- * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API
- * compatibility reasons and will be made <code>private</code> soon. Use
- * {@link #getSourceViewerDecorationSupport(ISourceViewer)} instead.</p>
- */
- protected SourceViewerDecorationSupport fSourceViewerDecorationSupport;
- /**
- * The line number column.
- *
- * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API
- * compatibility reasons and will be made <code>private</code> soon. Use
- * {@link AbstractTextEditor#getVerticalRuler()} to access the vertical bar instead.</p>
- */
- protected LineNumberRulerColumn fLineNumberRulerColumn;
- /**
- * The change ruler column.
- */
- private IChangeRulerColumn fChangeRulerColumn;
- /**
- * Whether quick diff information is displayed, either on a change ruler or the line number ruler.
- */
- private boolean fIsChangeInformationShown;
- /**
- * The annotation ruler column used in the vertical ruler.
- */
- private AnnotationRulerColumn fAnnotationRulerColumn;
- /**
- * The editor's implicit document provider.
- */
- private IDocumentProvider fImplicitDocumentProvider;
- /**
- * The editor's goto marker adapter.
- */
- private Object fGotoMarkerAdapter= new GotoMarkerAdapter();
-
-
- /**
- * Creates a new text editor.
- */
- public AbstractDecoratedTextEditor() {
- super();
- fAnnotationPreferences= new MarkerAnnotationPreferences();
- setRangeIndicator(new DefaultRangeIndicator());
- initializeKeyBindingScopes();
- initializeEditor();
- }
-
- /**
- * Initializes this editor. Subclasses may re-implement. If sub-classes do
- * not change the contract, this method should not be extended, i.e. do not
- * call <code>super.initializeEditor()</code> in order to avoid the
- * temporary creation of objects that are immediately overwritten by
- * subclasses.
- */
- protected void initializeEditor() {
- setPreferenceStore(EditorsPlugin.getDefault().getPreferenceStore());
- }
-
- /**
- * Initializes the key binding scopes of this editor.
- */
- protected void initializeKeyBindingScopes() {
- setKeyBindingScopes(new String[] { "org.eclipse.ui.textEditorScope" }); //$NON-NLS-1$
- }
-
- /*
- * @see IWorkbenchPart#dispose()
- */
- public void dispose() {
- if (fSourceViewerDecorationSupport != null) {
- fSourceViewerDecorationSupport.dispose();
- fSourceViewerDecorationSupport= null;
- }
-
- fAnnotationAccess= null;
- fAnnotationPreferences= null;
- fAnnotationRulerColumn= null;
-
- super.dispose();
- }
-
- /*
- * @see org.eclipse.ui.texteditor.AbstractTextEditor#createSourceViewer(Composite, IVerticalRuler, int)
- */
- protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
-
- fAnnotationAccess= createAnnotationAccess();
- fOverviewRuler= createOverviewRuler(getSharedColors());
-
- ISourceViewer viewer= new SourceViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
- // ensure decoration support has been created and configured.
- getSourceViewerDecorationSupport(viewer);
-
- return viewer;
- }
-
- protected ISharedTextColors getSharedColors() {
- ISharedTextColors sharedColors= EditorsPlugin.getDefault().getSharedTextColors();
- return sharedColors;
- }
-
- protected IOverviewRuler createOverviewRuler(ISharedTextColors sharedColors) {
- IOverviewRuler ruler= new OverviewRuler(getAnnotationAccess(), VERTICAL_RULER_WIDTH, sharedColors);
- Iterator e= fAnnotationPreferences.getAnnotationPreferences().iterator();
- while (e.hasNext()) {
- AnnotationPreference preference= (AnnotationPreference) e.next();
- if (preference.contributesToHeader())
- ruler.addHeaderAnnotationType(preference.getAnnotationType());
- }
- return ruler;
- }
-
- /**
- * Creates the annotation access for this editor.
- *
- * @return the created annotation access
- */
- protected IAnnotationAccess createAnnotationAccess() {
- return new DefaultMarkerAnnotationAccess();
- }
-
- /**
- * Configures the decoration support for this editor's source viewer. Subclasses may override this
- * method, but should call their superclass' implementation at some point.
- *
- * @param support the decoration support to configure
- */
- protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
-
- Iterator e= fAnnotationPreferences.getAnnotationPreferences().iterator();
- while (e.hasNext())
- support.setAnnotationPreference((AnnotationPreference) e.next());
-
- support.setCursorLinePainterPreferenceKeys(CURRENT_LINE, CURRENT_LINE_COLOR);
- support.setMarginPainterPreferenceKeys(PRINT_MARGIN, PRINT_MARGIN_COLOR, PRINT_MARGIN_COLUMN);
- support.setSymbolicFontName(getFontPropertyPreferenceKey());
- }
-
- /*
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
- if (fSourceViewerDecorationSupport != null)
- fSourceViewerDecorationSupport.install(getPreferenceStore());
-
- if (isPrefQuickDiffAlwaysOn())
- showChangeInformation(true);
- }
-
- /**
- * Tells whether the overview ruler is visible.
- *
- * @return whether the overview ruler is visible
- */
- protected boolean isOverviewRulerVisible() {
- IPreferenceStore store= getPreferenceStore();
- return store != null ? store.getBoolean(OVERVIEW_RULER) : false;
- }
-
- /*
- * @see org.eclipse.ui.texteditor.ITextEditorExtension3#showChangeInformation(boolean)
- */
- public void showChangeInformation(boolean show) {
- if (show == fIsChangeInformationShown)
- return;
-
- if (fIsChangeInformationShown) {
- uninstallChangeRulerModel();
- showChangeRuler(false); // hide change ruler if its displayed - if the line number ruler is showing, only the colors get removed by de-installing the model
- } else {
- ensureChangeInfoCanBeDisplayed();
- installChangeRulerModel();
- }
-
- if (getChangeColumn() != null && getChangeColumn().getModel() != null)
- fIsChangeInformationShown= true;
- else
- fIsChangeInformationShown= false;
- }
-
- /**
- * Installs the differ annotation model with the current quick diff display.
- */
- private void installChangeRulerModel() {
- IChangeRulerColumn column= getChangeColumn();
- if (column != null)
- column.setModel(getOrCreateDiffer());
- IOverviewRuler ruler= getOverviewRuler();
- if (ruler != null) {
- ruler.addAnnotationType("org.eclipse.ui.workbench.texteditor.quickdiffChange"); //$NON-NLS-1$
- ruler.addAnnotationType("org.eclipse.ui.workbench.texteditor.quickdiffAddition"); //$NON-NLS-1$
- ruler.addAnnotationType("org.eclipse.ui.workbench.texteditor.quickdiffDeletion"); //$NON-NLS-1$
- ruler.update();
- }
- }
-
- /**
- * Uninstalls the differ annotation model from the current quick diff display.
- */
- private void uninstallChangeRulerModel() {
- IChangeRulerColumn column= getChangeColumn();
- if (column != null)
- column.setModel(null);
- IOverviewRuler ruler= getOverviewRuler();
- if (ruler != null) {
- ruler.removeAnnotationType("org.eclipse.ui.workbench.texteditor.quickdiffChange"); //$NON-NLS-1$
- ruler.removeAnnotationType("org.eclipse.ui.workbench.texteditor.quickdiffAddition"); //$NON-NLS-1$
- ruler.removeAnnotationType("org.eclipse.ui.workbench.texteditor.quickdiffDeletion"); //$NON-NLS-1$
- ruler.update();
- }
- IAnnotationModel model= getDiffer();
- if (model instanceof DocumentLineDiffer)
- ((DocumentLineDiffer) model).suspend();
- }
-
- /**
- * Ensures that either the line number display is a <code>LineNumberChangeRuler</code> or
- * a separate change ruler gets displayed.
- */
- private void ensureChangeInfoCanBeDisplayed() {
- if (isLineNumberRulerVisible()) {
- if (!(fLineNumberRulerColumn instanceof IChangeRulerColumn)) {
- hideLineNumberRuler();
- // HACK: set state already so a change ruler is created. Not needed once always a change line number bar gets installed
- fIsChangeInformationShown= true;
- showLineNumberRuler();
- }
- } else
- showChangeRuler(true);
- }
-
- /*
- * @see org.eclipse.ui.texteditor.ITextEditorExtension3#isChangeInformationShowing()
- */
- public boolean isChangeInformationShowing() {
- return fIsChangeInformationShown;
- }
-
- /**
- * Extracts the line differ from the displayed document's annotation model. If none can be found,
- * a new differ is created and attached to the annotation model.
- *
- * @return the line differ, or <code>null</code> if none could be found or created
- */
- private IAnnotationModel getOrCreateDiffer() {
- IAnnotationModel differ= getDiffer();
- // create diff model if it doesn't
- if (differ == null) {
- IPreferenceStore store= getPreferenceStore();
- if (store != null) {
- String defaultId= store.getString(AbstractDecoratedTextEditorPreferenceConstants.QUICK_DIFF_DEFAULT_PROVIDER);
- differ= new QuickDiff().createQuickDiffAnnotationModel(this, defaultId);
- if (differ != null) {
- ISourceViewer viewer= getSourceViewer();
- if (viewer == null)
- return null;
-
- IAnnotationModel m= viewer.getAnnotationModel();
- IAnnotationModelExtension model;
- if (m instanceof IAnnotationModelExtension)
- model= (IAnnotationModelExtension) m;
- else
- return null;
- model.addAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID, differ);
- }
- }
- } else if (differ instanceof DocumentLineDiffer && !fIsChangeInformationShown)
- ((DocumentLineDiffer)differ).resume();
-
- return differ;
- }
-
- /**
- * Extracts the line differ from the displayed document's annotation model. If none can be found,
- * <code>null</code> is returned.
- *
- * @return the line differ, or <code>null</code> if none could be found
- */
- private IAnnotationModel getDiffer() {
- // get annotation model extension
- ISourceViewer viewer= getSourceViewer();
- if (viewer == null)
- return null;
-
- IAnnotationModel m= viewer.getAnnotationModel();
- IAnnotationModelExtension model;
- if (m instanceof IAnnotationModelExtension)
- model= (IAnnotationModelExtension) m;
- else
- return null;
-
- // get diff model if it exists already
- return model.getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
- }
-
- /**
- * Returns the <code>IChangeRulerColumn</code> of this editor, or <code>null</code> if there is none. Either
- * the line number bar or a separate change ruler column can be returned.
- *
- * @return an instance of <code>IChangeRulerColumn</code> or <code>null</code>.
- */
- private IChangeRulerColumn getChangeColumn() {
- if (fChangeRulerColumn != null)
- return fChangeRulerColumn;
- else if (fLineNumberRulerColumn instanceof IChangeRulerColumn)
- return (IChangeRulerColumn) fLineNumber