implemented resetting page counter when changing project
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -251,7 +251,10 @@ public class Toolbar extends JPanel {
|
|||||||
date = new DateChooser();
|
date = new DateChooser();
|
||||||
Dimension dim = new Dimension(400, 250);
|
Dimension dim = new Dimension(400, 250);
|
||||||
date.setMaximumSize(dim);
|
date.setMaximumSize(dim);
|
||||||
date.addActionListener(ev -> dateListeners.forEach(listener -> listener.setDate(date.getSelectedDate())));
|
date.addActionListener(ev -> {
|
||||||
|
resetPage();
|
||||||
|
dateListeners.forEach(listener -> listener.setDate(date.getSelectedDate()));
|
||||||
|
});
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,6 +356,19 @@ public class Toolbar extends JPanel {
|
|||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Toolbar resetPage(){
|
||||||
|
var page = t("PAGE");
|
||||||
|
var panel = additonalComponents.get(page);
|
||||||
|
if (panel == null) return this;
|
||||||
|
for (var child : panel.getComponents()){
|
||||||
|
if (child instanceof SelectComboBox scb){
|
||||||
|
scb.setText("1");
|
||||||
|
fieldListeners.forEach(l -> l.setField(page,"1"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Toolbar nextPage(){
|
public Toolbar nextPage(){
|
||||||
var page = t("PAGE");
|
var page = t("PAGE");
|
||||||
var panel = additonalComponents.get(page);
|
var panel = additonalComponents.get(page);
|
||||||
@@ -486,6 +502,7 @@ public class Toolbar extends JPanel {
|
|||||||
*/
|
*/
|
||||||
private void updateCat(String newCat) {
|
private void updateCat(String newCat) {
|
||||||
LOG.debug("updateCat({})",newCat);
|
LOG.debug("updateCat({})",newCat);
|
||||||
|
resetPage();
|
||||||
categoryListeners.forEach(l -> l.setCategory(newCat));
|
categoryListeners.forEach(l -> l.setCategory(newCat));
|
||||||
LOG.debug("Listeners notified.");
|
LOG.debug("Listeners notified.");
|
||||||
if (!newCat.isEmpty()) {
|
if (!newCat.isEmpty()) {
|
||||||
@@ -553,6 +570,7 @@ public class Toolbar extends JPanel {
|
|||||||
*/
|
*/
|
||||||
protected void updatePath(String newPath) {
|
protected void updatePath(String newPath) {
|
||||||
LOG.debug("updatePath({})",newPath);
|
LOG.debug("updatePath({})",newPath);
|
||||||
|
resetPage();
|
||||||
pathListeners.forEach(l -> l.setPath(newPath));
|
pathListeners.forEach(l -> l.setPath(newPath));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user