### Eclipse Workspace Patch 1.0
#P jverein
diff --git src/de/jost_net/JVerein/gui/control/BeitragsgruppeControl.java src/de/jost_net/JVerein/gui/control/BeitragsgruppeControl.java
index 312b772..c340c01 100644
--- src/de/jost_net/JVerein/gui/control/BeitragsgruppeControl.java
+++ src/de/jost_net/JVerein/gui/control/BeitragsgruppeControl.java
@@ -22,6 +22,7 @@
import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.action.BeitragsgruppeDetailAction;
import de.jost_net.JVerein.gui.formatter.BuchungsartFormatter;
+import de.jost_net.JVerein.gui.formatter.NotizFormatter;
import de.jost_net.JVerein.gui.menu.BeitragsgruppeMenu;
import de.jost_net.JVerein.keys.ArtBeitragsart;
import de.jost_net.JVerein.keys.BuchungsartSort;
@@ -37,6 +38,7 @@
import de.willuhn.jameica.gui.input.DecimalInput;
import de.willuhn.jameica.gui.input.Input;
import de.willuhn.jameica.gui.input.SelectInput;
+import de.willuhn.jameica.gui.input.TextAreaInput;
import de.willuhn.jameica.gui.input.TextInput;
import de.willuhn.jameica.gui.parts.TablePart;
import de.willuhn.logging.Logger;
@@ -69,6 +71,8 @@
private DecimalInput arbeitseinsatzbetrag;
private SelectInput buchungsart;
+
+ private TextAreaInput notiz;
public BeitragsgruppeControl(AbstractView view)
{
@@ -228,6 +232,18 @@
return buchungsart;
}
+ public TextAreaInput getNotiz() throws RemoteException
+ {
+ if (notiz != null)
+ {
+ return notiz;
+ }
+ notiz = new TextAreaInput(getBeitragsgruppe().getNotiz(), 200);
+ notiz.setName("Notiz");
+ notiz.setHeight(50);
+ return notiz;
+ }
+
public void handleStore()
{
try
@@ -269,6 +285,7 @@
b.setArbeitseinsatzStunden(d.doubleValue());
d = (Double) getArbeitseinsatzBetrag().getValue();
b.setArbeitseinsatzBetrag(d.doubleValue());
+ b.setNotiz((String) getNotiz().getValue());
b.store();
GUI.getStatusBar().setSuccessText("Beitragsgruppe gespeichert");
}
@@ -324,6 +341,7 @@
Einstellungen.DECIMALFORMAT));
}
beitragsgruppeList.addColumn("Buchungsart", "buchungsart", new BuchungsartFormatter());
+ beitragsgruppeList.addColumn("Notiz", "notiz", new NotizFormatter(40));
beitragsgruppeList.setContextMenu(new BeitragsgruppeMenu());
return beitragsgruppeList;
}
diff --git src/de/jost_net/JVerein/gui/formatter/NotizFormatter.java src/de/jost_net/JVerein/gui/formatter/NotizFormatter.java
new file mode 100644
index 0000000..dafdc88
--- /dev/null
+++ src/de/jost_net/JVerein/gui/formatter/NotizFormatter.java
@@ -0,0 +1,68 @@
+/**********************************************************************
+ * JVerein - Mitgliederverwaltung und einfache Buchhaltung für Vereine
+ * Copyright (c) by Heiner Jostkleigrewe
+ * Copyright (c) 2015 by Thomas Hooge
+ * Main Project: heiner@jverein.dem http://www.jverein.de/
+ * Module Author: thomas@hoogi.de, http://www.hoogi.de/
+ *
+ * This file is part of JVerein.
+ *
+ * JVerein is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * JVerein is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ **********************************************************************/
+package de.jost_net.JVerein.gui.formatter;
+
+import de.willuhn.jameica.gui.formatter.Formatter;
+
+/**
+ * Formatieren von einer mehrzeiligen Notiz zur Anzeige in einer Listenspalte.
+ * Es wird nur die erste Zeile angezeigt, zusätzlich kann die maximale
+ * Länge (in Zeichen) angegeben werden. Sind mehr Zeichen vorhanden, wird ein
+ * Ellipsis-Zeichen zur Markierung der Auslassung angezeigt.
+ *
+ * @author thooge
+ *
+ */
+public class NotizFormatter implements Formatter
+{
+
+ private Integer maxlength = null;
+
+ public NotizFormatter(Integer maxlength)
+ {
+ this.maxlength = maxlength;
+ }
+
+ @Override
+ public String format(Object o)
+ {
+ String notiz = (String) o;
+ if (notiz == null)
+ {
+ return "";
+ }
+ String[] lines = notiz.split("\r?\n|\r");
+ if ((maxlength != null) && (lines[0].length() > maxlength))
+ {
+ // Abschneiden und Ellipsis anhängen
+ return lines[0].substring(0, maxlength - 1) + "\u2026";
+ }
+ if (lines.length > 1)
+ {
+ return lines[0] + "\u2026";
+ }
+ return lines[0];
+ }
+
+}
\ No newline at end of file
diff --git src/de/jost_net/JVerein/gui/view/BeitragsgruppeDetailView.java src/de/jost_net/JVerein/gui/view/BeitragsgruppeDetailView.java
index 437fd9e..1d349c5 100644
--- src/de/jost_net/JVerein/gui/view/BeitragsgruppeDetailView.java
+++ src/de/jost_net/JVerein/gui/view/BeitragsgruppeDetailView.java
@@ -78,6 +78,8 @@
groupAe.addLabelPair("Betrag", control.getArbeitseinsatzBetrag());
}
+ group.addLabelPair("Notiz", control.getNotiz());
+
ButtonArea buttons = new ButtonArea();
buttons.addButton("Hilfe", new DokumentationAction(),
DokumentationUtil.BEITRAGSGRUPPEN, false, "help-browser.png");
diff --git src/de/jost_net/JVerein/rmi/Beitragsgruppe.java src/de/jost_net/JVerein/rmi/Beitragsgruppe.java
index 18a7538..998e0fe 100644
--- src/de/jost_net/JVerein/rmi/Beitragsgruppe.java
+++ src/de/jost_net/JVerein/rmi/Beitragsgruppe.java
@@ -69,4 +69,8 @@
public void setBuchungsart(Buchungsart buchungsart) throws RemoteException;
+ public String getNotiz() throws RemoteException;
+
+ public void setNotiz(String notiz) throws RemoteException;
+
}
diff --git src/de/jost_net/JVerein/server/BeitragsgruppeImpl.java src/de/jost_net/JVerein/server/BeitragsgruppeImpl.java
index 486d8ca..0ddd860 100644
--- src/de/jost_net/JVerein/server/BeitragsgruppeImpl.java
+++ src/de/jost_net/JVerein/server/BeitragsgruppeImpl.java
@@ -296,6 +296,18 @@
}
@Override
+ public String getNotiz() throws RemoteException
+ {
+ return (String) getAttribute("notiz");
+ }
+
+ @Override
+ public void setNotiz(String notiz) throws RemoteException
+ {
+ setAttribute("notiz", notiz);
+ }
+
+ @Override
public Object getAttribute(String fieldName) throws RemoteException
{
return super.getAttribute(fieldName);
diff --git src/de/jost_net/JVerein/server/DDLTool/Updates/Update0396.java src/de/jost_net/JVerein/server/DDLTool/Updates/Update0396.java
new file mode 100644
index 0000000..804e508
--- /dev/null
+++ src/de/jost_net/JVerein/server/DDLTool/Updates/Update0396.java
@@ -0,0 +1,48 @@
+/**********************************************************************
+ * JVerein - Mitgliederverwaltung und einfache Buchhaltung für Vereine
+ * Copyright (c) by Heiner Jostkleigrewe
+ * Copyright (c) 2015 by Thomas Hooge
+ * Main Project: heiner@jverein.dem http://www.jverein.de/
+ * Module Author: thomas@hoogi.de, http://www.hoogi.de/
+ *
+ * This file is part of JVerein.
+ *
+ * JVerein is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * JVerein is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ **********************************************************************/
+package de.jost_net.JVerein.server.DDLTool.Updates;
+
+import java.sql.Connection;
+
+import de.jost_net.JVerein.server.DDLTool.AbstractDDLUpdate;
+import de.jost_net.JVerein.server.DDLTool.Column;
+import de.willuhn.util.ApplicationException;
+import de.willuhn.util.ProgressMonitor;
+
+public class Update0396 extends AbstractDDLUpdate
+{
+ public Update0396(String driver, ProgressMonitor monitor, Connection conn)
+ {
+ super(driver, monitor, conn);
+ }
+
+ public void run() throws ApplicationException
+ {
+
+ // Eine kurze, interne Notiz zur Beitragsgruppe
+ execute(addColumn("beitragsgruppe", new Column("notiz",
+ COLTYPE.VARCHAR, 200, null, false, false)), false);
+
+ }
+}
\ No newline at end of file