Skip to content

Commit ddaa061

Browse files
committed
Filtered tree is implemented for Marker Support Views.
Bookmarks View, Problems View and Tasks Views will have a search filter box. see #4204
1 parent b5954f1 commit ddaa061

13 files changed

Lines changed: 856 additions & 7 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.20.0,4.0.0)";resol
6363
org.eclipse.e4.ui.ide;bundle-version="[3.15.0,4.0.0)";visibility:=reexport,
6464
org.eclipse.e4.core.di;bundle-version="[1.9.0,2.0.0)",
6565
org.eclipse.e4.core.di.extensions;bundle-version="[0.18.0,1.0.0)",
66+
org.eclipse.e4.ui.dialogs;bundle-version="[1.7.0,2.0.0)",
6667
org.eclipse.ui.navigator;bundle-version="3.12.0"
6768
Import-Package: jakarta.annotation;version="[2.0.0,4.0.0)",
6869
jakarta.inject;version="[2.0.0,3.0.0)",

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,11 @@ public interface IDEInternalPreferences {
179179
*/
180180
String HELP_CONTEXT_AVAILABILITY_CHECK = "helpContextAvailabilityCheck"; //$NON-NLS-1$
181181

182+
/**
183+
* Whether the filter search box in marker views (Bookmarks, Tasks and Problems)
184+
* should be shown or not initially. If the user customize the behavior in views
185+
* toolbar filters then this preference has no effect.
186+
*/
187+
String INITIALLY_SHOW_FILTER_TEXT_IN_MARKER_VIEWS = "INITIALLY_SHOW_FILTER_TEXT_IN_MARKER_VIEWS"; //$NON-NLS-1$
188+
182189
}

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEPreferenceInitializer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ public void initializeDefaultPreferences() {
9797
// by default the problem view should check whether help context is really
9898
// available.
9999
node.putBoolean(IDEInternalPreferences.HELP_CONTEXT_AVAILABILITY_CHECK, true);
100+
101+
// by default, marker views (Problems, Tasks, Bookmarks) show the
102+
// search box used to filter the shown markers
103+
node.putBoolean(IDEInternalPreferences.INITIALLY_SHOW_FILTER_TEXT_IN_MARKER_VIEWS, true);
100104
}
101105

102106
/**

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEWorkbenchMessages.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,9 @@ public class IDEWorkbenchMessages extends NLS {
522522
public static String WorkbenchPreference_unsupportedEncoding;
523523
public static String WorkbenchPreference_encoding_encodingMessage;
524524

525+
public static String WorkbenchPreference_showFilterTextInMarkerViews;
526+
public static String WorkbenchPreference_showFilterTextInMarkerViewsToolTip;
527+
525528
public static String UriHandlerPreferencePage_Warning_NotPossible;
526529
public static String UriHandlerPreferencePage_Warning_OtherApp_Description;
527530

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/IDEWorkbenchPreferencePage.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@
1717
package org.eclipse.ui.internal.ide.dialogs;
1818

1919
import org.eclipse.jface.preference.IPreferenceStore;
20+
import org.eclipse.swt.SWT;
21+
import org.eclipse.swt.widgets.Button;
2022
import org.eclipse.swt.widgets.Composite;
2123
import org.eclipse.swt.widgets.Control;
2224
import org.eclipse.ui.IWorkbenchPreferencePage;
2325
import org.eclipse.ui.PlatformUI;
2426
import org.eclipse.ui.internal.IWorkbenchHelpContextIds;
2527
import org.eclipse.ui.internal.dialogs.WorkbenchPreferencePage;
28+
import org.eclipse.ui.internal.ide.IDEInternalPreferences;
29+
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
2630
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
2731

2832
/**
@@ -33,6 +37,8 @@
3337
*/
3438
public class IDEWorkbenchPreferencePage extends WorkbenchPreferencePage implements IWorkbenchPreferencePage {
3539

40+
private Button showFilterTextInMarkerViewsButton;
41+
3642
@Override
3743
protected Control createContents(Composite parent) {
3844

@@ -42,6 +48,7 @@ protected Control createContents(Composite parent) {
4248

4349
createSettings(composite);
4450
createInlineRenamePref(composite);
51+
createShowFilterTextInMarkerViewsPref(composite);
4552
createSaveIntervalGroup(composite);
4653
createOpenModeGroup(composite);
4754

@@ -50,6 +57,34 @@ protected Control createContents(Composite parent) {
5057
return composite;
5158
}
5259

60+
/**
61+
* Create the widget controlling whether marker views (Problems, Tasks,
62+
* Bookmarks etc.) of a kind never customized by the user before initially
63+
* show the search box used to filter the shown markers.
64+
*/
65+
protected void createShowFilterTextInMarkerViewsPref(Composite composite) {
66+
showFilterTextInMarkerViewsButton = new Button(composite, SWT.CHECK);
67+
showFilterTextInMarkerViewsButton.setText(IDEWorkbenchMessages.WorkbenchPreference_showFilterTextInMarkerViews);
68+
showFilterTextInMarkerViewsButton
69+
.setToolTipText(IDEWorkbenchMessages.WorkbenchPreference_showFilterTextInMarkerViewsToolTip);
70+
showFilterTextInMarkerViewsButton.setSelection(getIDEPreferenceStore()
71+
.getBoolean(IDEInternalPreferences.INITIALLY_SHOW_FILTER_TEXT_IN_MARKER_VIEWS));
72+
}
73+
74+
@Override
75+
protected void performDefaults() {
76+
showFilterTextInMarkerViewsButton.setSelection(getIDEPreferenceStore()
77+
.getDefaultBoolean(IDEInternalPreferences.INITIALLY_SHOW_FILTER_TEXT_IN_MARKER_VIEWS));
78+
super.performDefaults();
79+
}
80+
81+
@Override
82+
public boolean performOk() {
83+
getIDEPreferenceStore().setValue(IDEInternalPreferences.INITIALLY_SHOW_FILTER_TEXT_IN_MARKER_VIEWS,
84+
showFilterTextInMarkerViewsButton.getSelection());
85+
return super.performOk();
86+
}
87+
5388
/**
5489
* Returns the IDE preference store.
5590
* @return the preference store.

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/messages.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,9 @@ WorkbenchPreference_unsupportedEncoding = The selected encoding is not supported
501501

502502
WorkbenchPreference_encoding_encodingMessage = Byte Order Mark is {0}
503503

504+
WorkbenchPreference_showFilterTextInMarkerViews = &Initially show text filter in marker views
505+
WorkbenchPreference_showFilterTextInMarkerViewsToolTip = This preference is used to show/hide the text filter in the Problems, Tasks, Bookmarks views. This preference has effect only if the user has not explicitly set the visibility of the text filter in the view's Toolbar filter.
506+
504507
# --- Link Handler Preference Page ---
505508
UriHandlerPreferencePage_Warning_NotPossible=Action not possible
506509
UriHandlerPreferencePage_Warning_OtherApp_Description=Another application ({0}) handles the "{1}" scheme.\n\nRemove the "{1}" scheme in the other application first.

0 commit comments

Comments
 (0)