package beaform.gui.formulaeditor;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.DefaultListModel;
import javax.swing.JList;

import beaform.entities.Ingredient;

public final class DelIngredientAction implements ActionListener {

	private final DefaultListModel<Ingredient> lstFormulaModel;
	private final JList<Ingredient> lstFormulas;

	public DelIngredientAction(JList<Ingredient> lstFormulas, DefaultListModel<Ingredient> lstFormulaModel) {
		this.lstFormulaModel = lstFormulaModel;
		this.lstFormulas = lstFormulas;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		while (!this.lstFormulas.isSelectionEmpty()) {
			int selected = this.lstFormulas.getSelectedIndex();
			this.lstFormulaModel.remove(selected);
		}
	}
}
@@ -204,16 +204,120 @@
 dient;%0A%0A
+/**%0A * This action removes an ingredient from the list of ingredients.%0A *%0A * @author Steven Post%0A *%0A */%0A
 public f
@@ -376,16 +376,62 @@
 ener %7B%0A%0A
+%09/**%0A%09 * The list model for ingredients.%0A%09 */%0A
 %09private
@@ -482,16 +482,44 @@
 laModel;
+%0A%0A%09/** The graphical list */
 %0A%09privat
@@ -558,16 +558,148 @@
 mulas;%0A%0A
+%09/**%0A%09 * Constructor%0A%09 *%0A%09 * @param lstFormulas The graphical list.%0A%09 * @param lstFormulaModel The list model for ingredients.%0A%09 */%0A
 %09public 
@@ -718,16 +718,22 @@
 tAction(
+final 
 JList%3CIn
@@ -754,16 +754,22 @@
 ormulas,
+ final
  Default
@@ -889,16 +889,120 @@
 as;%0A%09%7D%0A%0A
+%09/**%0A%09 * This method is invoked when the event is triggered.%0A%09 *%0A%09 * @param event The event object%0A%09 */%0A
 %09@Overri
@@ -1033,16 +1033,22 @@
 rformed(
+final 
 ActionEv
@@ -1052,16 +1052,20 @@
 nEvent e
+vent
 ) %7B%0A%09%09wh
@@ -1112,16 +1112,22 @@
 )) %7B%0A%09%09%09
+final 
 int sele

Fix several PMD violations