Skip to content

Commit 8a2fafd

Browse files
Maximilian WittmerMaximilian Wittmer
authored andcommitted
Implemented Find-Replace Overlay.
In response to issue eclipse-platform#1090. Goals for this overlay are a simple and modern UI/UX for finding/replacing in eclipse.
1 parent c1cf342 commit 8a2fafd

32 files changed

+1619
-92
lines changed

bundles/org.eclipse.ui.editors/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.ui.editors; singleton:=true
5-
Bundle-Version: 3.17.200.qualifier
5+
Bundle-Version: 3.17.300.qualifier
66
Bundle-Activator: org.eclipse.ui.internal.editors.text.EditorsPlugin
77
Bundle-ActivationPolicy: lazy
88
Bundle-Vendor: %providerName

bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorDefaultsPreferencePage.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ private OverlayPreferenceStore createDialogOverlayStore() {
428428
ArrayList<OverlayKey> overlayKeys= new ArrayList<>();
429429

430430
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_LEADING_SPACES));
431+
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_FIND_REPLACE_OVERLAY));
431432
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_ENCLOSED_SPACES));
432433
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_TRAILING_SPACES));
433434
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_LEADING_IDEOGRAPHIC_SPACES));
@@ -729,6 +730,7 @@ private OverlayPreferenceStore createOverlayStore() {
729730
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractTextEditor.PREFERENCE_COLOR_FIND_SCOPE));
730731

731732
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR));
733+
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_FIND_REPLACE_OVERLAY));
732734
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE));
733735

734736
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH));
@@ -859,6 +861,10 @@ public void widgetSelected(SelectionEvent e) {
859861
IntegerDomain lineSpaceDomain= new IntegerDomain(0, 1000);
860862
addTextField(appearanceComposite, lineSpacing, lineSpaceDomain, 15, 0);
861863

864+
label= TextEditorMessages.TextEditorPreferencePage_useFindReplaceOverlay;
865+
Preference useFindReplaceOverlay= new Preference(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_USE_FIND_REPLACE_OVERLAY, label, null);
866+
addCheckBox(appearanceComposite, useFindReplaceOverlay, new BooleanDomain(), 0);
867+
862868
label= TextEditorMessages.TextEditorPreferencePage_enableWordWrap;
863869
Preference enableWordWrap= new Preference(AbstractTextEditor.PREFERENCE_WORD_WRAP_ENABLED, label, null);
864870
addCheckBox(appearanceComposite, enableWordWrap, new BooleanDomain(), 0);

bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ private TextEditorMessages() {
3535
public static String LinkedModeConfigurationBlock_DASHED_BOX;
3636
public static String TextEditorPreferencePage_displayedTabWidth;
3737
public static String TextEditorPreferencePage_lineSpacing;
38+
39+
public static String TextEditorPreferencePage_useFindReplaceOverlay;
3840
public static String TextEditorPreferencePage_enableWordWrap;
3941
public static String TextEditorPreferencePage_convertTabsToSpaces;
4042
public static String TextEditorPreferencePage_undoHistorySize;

bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/TextEditorMessages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ EditorsPlugin_internal_error=Internal Error
1717

1818
TextEditorPreferencePage_displayedTabWidth=Displayed &tab width:
1919
TextEditorPreferencePage_lineSpacing=Line &spacing (extra % of font height):
20+
TextEditorPreferencePage_useFindReplaceOverlay=Use modern Find/Replace-Overlay
2021
TextEditorPreferencePage_enableWordWrap=&Enable word wrap when opening an editor
2122
TextEditorPreferencePage_convertTabsToSpaces=&Insert spaces for tabs
2223
TextEditorPreferencePage_undoHistorySize=&Undo history size:

bundles/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,18 @@ private AbstractDecoratedTextEditorPreferenceConstants() {
220220
* </p>
221221
*/
222222
public final static String EDITOR_LINE_NUMBER_RULER= "lineNumberRuler"; //$NON-NLS-1$
223+
224+
/**
225+
* A named preference that controls whether the modern "Find/Replace"-Overlay is used in place
226+
* of the classical Find/Replace-Dialog.
227+
*
228+
* <p>
229+
* The preference value is of type <code>Boolean</code>
230+
* </p>
231+
*
232+
* @since 3.17
233+
*/
234+
public final static String EDITOR_USE_FIND_REPLACE_OVERLAY= "usefindreplaceoverlay"; //$NON-NLS-1$
223235

224236
/**
225237
* A named preference that controls if the caret offset is shown in the status line.
@@ -723,6 +735,7 @@ private AbstractDecoratedTextEditorPreferenceConstants() {
723735
* @param store the preference store to be initialized
724736
*/
725737
public static void initializeDefaultValues(IPreferenceStore store) {
738+
store.setDefault("usefindreplaceoverlay", false); //$NON-NLS-1$
726739
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.USE_ANNOTATIONS_PREFERENCE_PAGE, false);
727740
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.USE_QUICK_DIFF_PREFERENCE_PAGE, false);
728741

@@ -736,6 +749,7 @@ public static void initializeDefaultValues(IPreferenceStore store) {
736749

737750
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_UNDO_HISTORY_SIZE, 200);
738751

752+
store.setDefault("usefindreplaceoverlay", false);
739753
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN, false);
740754
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN, 80);
741755
store.setDefault(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_ALLOW_OVERRIDE, false);

bundles/org.eclipse.ui.workbench.texteditor/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.ui.workbench.texteditor; singleton:=true
5-
Bundle-Version: 3.17.300.qualifier
5+
Bundle-Version: 3.18.0.qualifier
66
Bundle-Activator: org.eclipse.ui.internal.texteditor.TextEditorPlugin
77
Bundle-ActivationPolicy: lazy
88
Bundle-Vendor: %providerName
315 Bytes
Loading
315 Bytes
Loading
366 Bytes
Loading
364 Bytes
Loading

0 commit comments

Comments
 (0)