Skip to content

Commit 4ac15a8

Browse files
committed
Improve Problems view filter dialog UX and fix vanishing markers
- Replace 5 scope radio buttons with compact Combo dropdown - Strip mnemonic characters from combo labels - Disable configuration group when 'Show all items' is checked - Collapse advanced filter sections (Types) by default - Combine limit controls into single 'Limit items per group:' row - Fix vanishing markers when no resources selected (empty resources fallback to show all in selectByScope) - Update ScopeAreaTest for Combo widget, add MarkerFieldFilterGroupTest with 8 tests covering selectByScope behavior
1 parent 06b47e7 commit 4ac15a8

File tree

10 files changed

+370
-254
lines changed

10 files changed

+370
-254
lines changed

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/FiltersConfigurationDialog.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ public class FiltersConfigurationDialog extends TrayDialog {
9898
private ScrolledForm form;
9999

100100
private Collection<FilterConfigurationArea> configAreas;
101-
private Label limitsLabel;
102101

103102
private Object[] previouslyChecked = new Object[0];
104103
private Group configComposite;
105-
private Composite compositeLimits;
104+
private Composite allConfigArea;
106105

107106
/**
108107
* Create a new instance of the receiver on builder.
@@ -201,6 +200,8 @@ private void updateRadioButtonsFromTable() {
201200
boolean showAll = isShowAll();
202201
allButton.setSelection(showAll);
203202
updateConfigComposite(!showAll);
203+
setEnabled(!showAll, configComposite);
204+
setEnabled(!showAll, allConfigArea);
204205
}
205206

206207
private void updateConfigComposite(boolean enabled) {
@@ -212,7 +213,6 @@ private void updateConfigComposite(boolean enabled) {
212213
/** Update the enablement of limitText */
213214
private void updateLimitTextEnablement() {
214215
boolean useLimits = limitButton.getSelection();
215-
limitsLabel.setEnabled(useLimits);
216216
limitText.setEnabled(useLimits);
217217
}
218218

@@ -221,6 +221,10 @@ private void updateShowAll(boolean showAll) {
221221
updateConfigComposite(!showAll);
222222
updateLimitTextEnablement();
223223

224+
// Disable the configurations group and limit area when showing all items
225+
setEnabled(!showAll, configComposite);
226+
setEnabled(!showAll, allConfigArea);
227+
224228
if (showAll) {
225229
previouslyChecked = configsTable.getCheckedElements();
226230
configsTable.setAllChecked(false);
@@ -243,39 +247,29 @@ private boolean isShowAll() {
243247
* Create the area of the dialog that apply's to all configurations.
244248
*/
245249
private void createAllConfigArea(Composite parent) {
246-
compositeLimits = new Composite(parent, SWT.NONE);
247-
GridLayout glCompositeLimits = new GridLayout(3, false);
248-
compositeLimits.setLayout(glCompositeLimits);
250+
allConfigArea = new Composite(parent, SWT.NONE);
251+
GridLayout layout = new GridLayout(3, false);
252+
layout.marginHeight = 0;
253+
allConfigArea.setLayout(layout);
254+
allConfigArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
249255

250-
limitButton = new Button(compositeLimits, SWT.CHECK);
251-
limitButton.setText(MarkerMessages.MarkerPreferences_MarkerLimits);
256+
limitButton = new Button(allConfigArea, SWT.CHECK);
257+
limitButton.setText(MarkerMessages.filtersDialog_limitItemsPerGroup);
252258
limitButton.addSelectionListener(new SelectionAdapter() {
253259

254260
@Override
255261
public void widgetSelected(SelectionEvent e) {
256262
updateLimitTextEnablement();
257263
}
258264
});
259-
260265
GridData limitData = new GridData();
261266
limitData.verticalIndent = 5;
262267
limitButton.setLayoutData(limitData);
263268

264-
Composite composite = new Composite(parent, SWT.NONE);
265-
GridLayout layout = new GridLayout(3, false);
266-
layout.marginWidth = 0;
267-
layout.marginHeight = 0;
268-
composite.setLayout(layout);
269-
GridData compositeData = new GridData(GridData.FILL_HORIZONTAL);
270-
compositeData.horizontalIndent = 20;
271-
composite.setLayoutData(compositeData);
272-
273-
limitsLabel = new Label(composite, SWT.NONE);
274-
limitsLabel.setText(MarkerMessages.MarkerPreferences_VisibleItems);
275-
276-
limitText = new Text(composite, SWT.BORDER);
269+
limitText = new Text(allConfigArea, SWT.BORDER);
277270
GridData textData = new GridData();
278271
textData.widthHint = convertWidthInCharsToPixels(10);
272+
textData.verticalIndent = 5;
279273
limitText.setLayoutData(textData);
280274
limitText.addVerifyListener(e -> {
281275
if (e.character != 0 && e.keyCode != SWT.BS
@@ -300,7 +294,7 @@ public void widgetSelected(SelectionEvent e) {
300294
}
301295
});
302296

303-
Composite defaultButtonComposite = new Composite(composite, SWT.NONE);
297+
Composite defaultButtonComposite = new Composite(allConfigArea, SWT.NONE);
304298
GridLayout defaultButtonLayout = new GridLayout(1, false);
305299
defaultButtonComposite.setLayout(defaultButtonLayout);
306300
GridData defaultButtonCompositeData = new GridData(SWT.END, SWT.END, true, false);
@@ -402,10 +396,16 @@ private void createConfigDesc(Composite parent) {
402396

403397
configAreas = generator.createFilterConfigurationFields();
404398

399+
// Scope and severity/description are always expanded (most used)
405400
createFieldArea(toolkit, form, scopeArea, true);
406401
Iterator<FilterConfigurationArea> areas = configAreas.iterator();
402+
boolean isFirst = true;
407403
while (areas.hasNext()) {
408-
createFieldArea(toolkit, form, areas.next(), true);
404+
FilterConfigurationArea area = areas.next();
405+
// First config area (severity/description) is always expanded,
406+
// subsequent areas (types) start collapsed to reduce clutter
407+
createFieldArea(toolkit, form, area, isFirst);
408+
isFirst = false;
409409
}
410410
}
411411

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/MarkerFieldFilterGroup.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,11 @@ public boolean selectByFilters(MarkerEntry entry) {
649649

650650
public boolean selectByScope(MarkerEntry entry, IResource[] resources) {
651651
int scopeVal = getScope();
652+
// When no resources are selected and scope depends on selection,
653+
// fall back to showing all markers to avoid confusing empty results
654+
if (resources.length == 0 && scopeVal != ON_ANY && scopeVal != ON_WORKING_SET) {
655+
return true;
656+
}
652657
switch (scopeVal) {
653658
case MarkerFieldFilterGroup.ON_ANY: {
654659
return true;

0 commit comments

Comments
 (0)