Skip to content

Commit

Permalink
Submenü für freie Formulare (#332)
Browse files Browse the repository at this point in the history
* Submenü für freie Formulare

* Iterator übergeben
  • Loading branch information
JohannMaierhofer authored Sep 29, 2024
1 parent 69e4370 commit 920b16e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
42 changes: 42 additions & 0 deletions src/de/jost_net/JVerein/gui/menu/FreieFormulareMenu.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**********************************************************************
* Copyright (c) by Heiner Jostkleigrewe
* This program 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.
*
* This program 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 <http://www.gnu.org/licenses/>.
*
* [email protected]
* www.jverein.de
**********************************************************************/
package de.jost_net.JVerein.gui.menu;

import java.rmi.RemoteException;

import de.jost_net.JVerein.gui.action.FreiesFormularAction;
import de.jost_net.JVerein.rmi.Formular;
import de.willuhn.datasource.rmi.DBIterator;
import de.willuhn.jameica.gui.parts.CheckedContextMenuItem;
import de.willuhn.jameica.gui.parts.ContextMenu;

/**
* Kontext-Menu zu den Mails.
*/
public class FreieFormulareMenu extends ContextMenu
{

public FreieFormulareMenu(DBIterator<Formular> it) throws RemoteException
{
while (it.hasNext())
{
Formular f = (Formular) it.next();
addItem(new CheckedContextMenuItem(f.getBezeichnung(),
new FreiesFormularAction(f.getID()), "file-invoice.png"));
}
}
}
14 changes: 7 additions & 7 deletions src/de/jost_net/JVerein/gui/menu/MitgliedMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import de.jost_net.JVerein.Einstellungen;
import de.jost_net.JVerein.gui.action.NichtMitgliedDetailAction;
import de.jost_net.JVerein.gui.action.FreiesFormularAction;
import de.jost_net.JVerein.gui.action.KontoauszugAction;
import de.jost_net.JVerein.gui.action.MitgliedArbeitseinsatzZuordnungAction;
import de.jost_net.JVerein.gui.action.MitgliedDeleteAction;
Expand Down Expand Up @@ -111,7 +110,7 @@ public void handleAction(Object context) throws ApplicationException
throw new ApplicationException(e);
}
}
}, "arrows-alt-h.png"));
}, "view-refresh.png"));
}
else
{
Expand Down Expand Up @@ -170,7 +169,7 @@ public void handleAction(Object context) throws ApplicationException
throw new ApplicationException(e);
}
}
}, "arrows-alt-h.png"));
}, "view-refresh.png"));
}
if (detailaction instanceof NichtMitgliedDetailAction)
{
Expand Down Expand Up @@ -212,11 +211,12 @@ public void handleAction(Object context) throws ApplicationException
.createList(Formular.class);
it.addFilter("art = ?",
new Object[] { FormularArt.FREIESFORMULAR.getKey() });
while (it.hasNext())
if (it.hasNext())
{
Formular f = (Formular) it.next();
addItem(new CheckedContextMenuItem(f.getBezeichnung(),
new FreiesFormularAction(f.getID()), "file-invoice.png"));
addItem(ContextMenuItem.SEPARATOR);
ContextMenu freieformularemenu = new FreieFormulareMenu(it);
freieformularemenu.setText("Freie Formulare");
addMenu(freieformularemenu);
}
}
}

0 comments on commit 920b16e

Please sign in to comment.