From 536924b31b2696f44f8d6f4233bfa6c68f9b9cc4 Mon Sep 17 00:00:00 2001 From: Johann Maierhofer Date: Fri, 24 Jan 2025 10:39:29 +0100 Subject: [PATCH] Kleine Optimierung --- .../gui/control/MittelverwendungControl.java | 43 ++++++------------- .../gui/parts/MittelverwendungList.java | 1 + 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/src/de/jost_net/JVerein/gui/control/MittelverwendungControl.java b/src/de/jost_net/JVerein/gui/control/MittelverwendungControl.java index cd366cf8a..71a5435e4 100644 --- a/src/de/jost_net/JVerein/gui/control/MittelverwendungControl.java +++ b/src/de/jost_net/JVerein/gui/control/MittelverwendungControl.java @@ -111,40 +111,23 @@ public Part getSaldoList() throws ApplicationException public Part getSaldoList(int tab) throws ApplicationException { - try + if (getDatumvon().getDate() != null) { - if (getDatumvon().getDate() != null) - { - settings.setAttribute("von", - new JVDateFormatTTMMJJJJ().format(getDatumvon().getDate())); - settings.setAttribute("bis", - new JVDateFormatTTMMJJJJ().format(getDatumbis().getDate())); - } + settings.setAttribute("von", + new JVDateFormatTTMMJJJJ().format(getDatumvon().getDate())); + settings.setAttribute("bis", + new JVDateFormatTTMMJJJJ().format(getDatumbis().getDate())); + } - if (saldoList[tab] == null) - { - saldoList[tab] = new MittelverwendungList(null, datumvon.getDate(), - datumbis.getDate(), tab); - } - else - { - settings.setAttribute("von", - new JVDateFormatTTMMJJJJ().format(getDatumvon().getDate())); - - saldoList[tab].setDatumvon(datumvon.getDate()); - saldoList[tab].setDatumbis(datumbis.getDate()); - ArrayList zeile = saldoList[tab].getInfo(); - saldoList[tab].removeAll(); - for (MittelverwendungZeile sz : zeile) - { - saldoList[tab].addItem(sz); - } - } + if (saldoList[tab] == null) + { + saldoList[tab] = new MittelverwendungList(null, datumvon.getDate(), + datumbis.getDate(), tab); } - catch (RemoteException e) + else { - throw new ApplicationException( - String.format("Fehler aufgetreten %s", e.getMessage())); + saldoList[tab].setDatumvon(datumvon.getDate()); + saldoList[tab].setDatumbis(datumbis.getDate()); } return saldoList[tab].getSaldoList(); } diff --git a/src/de/jost_net/JVerein/gui/parts/MittelverwendungList.java b/src/de/jost_net/JVerein/gui/parts/MittelverwendungList.java index 563210e51..a6cca5e6f 100644 --- a/src/de/jost_net/JVerein/gui/parts/MittelverwendungList.java +++ b/src/de/jost_net/JVerein/gui/parts/MittelverwendungList.java @@ -92,6 +92,7 @@ protected void orderBy(int index) Column.ALIGN_LEFT); saldoList.addColumn("Kommentar", "kommentar"); saldoList.setRememberColWidths(true); + saldoList.setRememberOrder(true); saldoList.removeFeature(FeatureSummary.class); } else