Skip to content

Commit a9de653

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 ed75400 commit a9de653

File tree

10 files changed

+368
-254
lines changed

10 files changed

+368
-254
lines changed

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

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

102102
private Collection<FilterConfigurationArea> configAreas;
103-
private Label limitsLabel;
104103

105104
private Object[] previouslyChecked = new Object[0];
106105
private Group configComposite;
107-
private Composite compositeLimits;
106+
private Composite allConfigArea;
108107

109108
/**
110109
* Create a new instance of the receiver on builder.
@@ -224,7 +223,6 @@ private void updateConfigComposite(boolean enabled) {
224223
/** Update the enablement of limitText */
225224
private void updateLimitTextEnablement() {
226225
boolean useLimits = limitButton.getSelection();
227-
limitsLabel.setEnabled(useLimits);
228226
limitText.setEnabled(useLimits);
229227
}
230228

@@ -233,6 +231,10 @@ private void updateShowAll(boolean showAll) {
233231
updateConfigComposite(!showAll);
234232
updateLimitTextEnablement();
235233

234+
// Disable the configurations group and limit area when showing all items
235+
setEnabled(!showAll, configComposite);
236+
setEnabled(!showAll, allConfigArea);
237+
236238
if (showAll) {
237239
previouslyChecked = configsTable.getCheckedElements();
238240
configsTable.setAllChecked(false);
@@ -255,39 +257,29 @@ private boolean isShowAll() {
255257
* Create the area of the dialog that apply's to all configurations.
256258
*/
257259
private void createAllConfigArea(Composite parent) {
258-
compositeLimits = new Composite(parent, SWT.NONE);
259-
GridLayout glCompositeLimits = new GridLayout(3, false);
260-
compositeLimits.setLayout(glCompositeLimits);
260+
allConfigArea = new Composite(parent, SWT.NONE);
261+
GridLayout layout = new GridLayout(3, false);
262+
layout.marginHeight = 0;
263+
allConfigArea.setLayout(layout);
264+
allConfigArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
261265

262-
limitButton = new Button(compositeLimits, SWT.CHECK);
263-
limitButton.setText(MarkerMessages.MarkerPreferences_MarkerLimits);
266+
limitButton = new Button(allConfigArea, SWT.CHECK);
267+
limitButton.setText(MarkerMessages.filtersDialog_limitItemsPerGroup);
264268
limitButton.addSelectionListener(new SelectionAdapter() {
265269

266270
@Override
267271
public void widgetSelected(SelectionEvent e) {
268272
updateLimitTextEnablement();
269273
}
270274
});
271-
272275
GridData limitData = new GridData();
273276
limitData.verticalIndent = 5;
274277
limitButton.setLayoutData(limitData);
275278

276-
Composite composite = new Composite(parent, SWT.NONE);
277-
GridLayout layout = new GridLayout(3, false);
278-
layout.marginWidth = 0;
279-
layout.marginHeight = 0;
280-
composite.setLayout(layout);
281-
GridData compositeData = new GridData(GridData.FILL_HORIZONTAL);
282-
compositeData.horizontalIndent = 20;
283-
composite.setLayoutData(compositeData);
284-
285-
limitsLabel = new Label(composite, SWT.NONE);
286-
limitsLabel.setText(MarkerMessages.MarkerPreferences_VisibleItems);
287-
288-
limitText = new Text(composite, SWT.BORDER);
279+
limitText = new Text(allConfigArea, SWT.BORDER);
289280
GridData textData = new GridData();
290281
textData.widthHint = convertWidthInCharsToPixels(10);
282+
textData.verticalIndent = 5;
291283
limitText.setLayoutData(textData);
292284
limitText.addVerifyListener(e -> {
293285
if (e.character != 0 && e.keyCode != SWT.BS
@@ -312,7 +304,7 @@ public void widgetSelected(SelectionEvent e) {
312304
}
313305
});
314306

315-
Composite defaultButtonComposite = new Composite(composite, SWT.NONE);
307+
Composite defaultButtonComposite = new Composite(allConfigArea, SWT.NONE);
316308
GridLayout defaultButtonLayout = new GridLayout(1, false);
317309
defaultButtonComposite.setLayout(defaultButtonLayout);
318310
GridData defaultButtonCompositeData = new GridData(SWT.END, SWT.END, true, false);
@@ -414,10 +406,16 @@ private void createConfigDesc(Composite parent) {
414406

415407
configAreas = generator.createFilterConfigurationFields();
416408

409+
// Scope and severity/description are always expanded (most used)
417410
createFieldArea(toolkit, form, scopeArea, true);
418411
Iterator<FilterConfigurationArea> areas = configAreas.iterator();
412+
boolean isFirst = true;
419413
while (areas.hasNext()) {
420-
createFieldArea(toolkit, form, areas.next(), true);
414+
FilterConfigurationArea area = areas.next();
415+
// First config area (severity/description) is always expanded,
416+
// subsequent areas (types) start collapsed to reduce clutter
417+
createFieldArea(toolkit, form, area, isFirst);
418+
isFirst = false;
421419
}
422420
}
423421

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)