SEBSERV-247

This commit is contained in:
anhefti 2022-01-24 09:24:14 +01:00
parent 2f8f8296d7
commit 7a71839124
2 changed files with 24 additions and 0 deletions

View file

@ -44,6 +44,7 @@ public final class Constants {
public static final int DAY_IN_MIN = 60 * 24; public static final int DAY_IN_MIN = 60 * 24;
public static final Character ENTER = '\r';
public static final Character CARRIAGE_RETURN = '\n'; public static final Character CARRIAGE_RETURN = '\n';
public static final Character CURLY_BRACE_OPEN = '{'; public static final Character CURLY_BRACE_OPEN = '{';
public static final Character CURLY_BRACE_CLOSE = '}'; public static final Character CURLY_BRACE_CLOSE = '}';

View file

@ -331,6 +331,11 @@ public class TableFilter<ROW> {
getAriaLabel()); getAriaLabel());
this.textInput.setLayoutData(gridData); this.textInput.setLayoutData(gridData);
this.textInput.addListener(SWT.KeyUp, event -> {
if (event.keyCode == Constants.ENTER.hashCode()) {
TableFilter.this.entityTable.applyFilter();
}
});
return this; return this;
} }
@ -387,6 +392,9 @@ public class TableFilter<ROW> {
this.selector this.selector
.adaptToControl() .adaptToControl()
.setLayoutData(gridData); .setLayoutData(gridData);
this.selector.setSelectionListener(event -> {
TableFilter.this.entityTable.applyFilter();
});
return this; return this;
} }
@ -439,6 +447,9 @@ public class TableFilter<ROW> {
this.selector = TableFilter.this.entityTable.widgetFactory.dateSelector( this.selector = TableFilter.this.entityTable.widgetFactory.dateSelector(
innerComposite, innerComposite,
getAriaLabel()); getAriaLabel());
this.selector.addListener(SWT.Selection, event -> {
TableFilter.this.entityTable.applyFilter();
});
return this; return this;
} }
@ -532,14 +543,26 @@ public class TableFilter<ROW> {
final WidgetFactory wf = TableFilter.this.entityTable.widgetFactory; final WidgetFactory wf = TableFilter.this.entityTable.widgetFactory;
wf.labelLocalized(this.innerComposite, DATE_FROM_TEXT); wf.labelLocalized(this.innerComposite, DATE_FROM_TEXT);
this.fromDateSelector = wf.dateSelector(this.innerComposite, getAriaLabel()); this.fromDateSelector = wf.dateSelector(this.innerComposite, getAriaLabel());
this.fromDateSelector.addListener(SWT.Selection, event -> {
TableFilter.this.entityTable.applyFilter();
});
if (this.withTime) { if (this.withTime) {
this.fromTimeSelector = wf.timeSelector(this.innerComposite, getAriaLabel()); this.fromTimeSelector = wf.timeSelector(this.innerComposite, getAriaLabel());
this.fromTimeSelector.addListener(SWT.Selection, event -> {
TableFilter.this.entityTable.applyFilter();
});
} }
wf.labelLocalized(this.innerComposite, DATE_TO_TEXT); wf.labelLocalized(this.innerComposite, DATE_TO_TEXT);
this.toDateSelector = wf.dateSelector(this.innerComposite, getAriaLabel()); this.toDateSelector = wf.dateSelector(this.innerComposite, getAriaLabel());
this.toDateSelector.addListener(SWT.Selection, event -> {
TableFilter.this.entityTable.applyFilter();
});
if (this.withTime) { if (this.withTime) {
this.toTimeSelector = wf.timeSelector(this.innerComposite, getAriaLabel()); this.toTimeSelector = wf.timeSelector(this.innerComposite, getAriaLabel());
this.toTimeSelector.addListener(SWT.Selection, event -> {
TableFilter.this.entityTable.applyFilter();
});
} }
return this; return this;