/****************************************************************************
 * Copyright (C) 2013 ecsec GmbH.
 * All rights reserved.
 * Contact: ecsec GmbH (info@ecsec.de)
 *
 * This file is part of the Open eCard App.
 *
 * GNU General Public License Usage
 * This file may be used under the terms of the GNU General Public
 * License version 3.0 as published by the Free Software Foundation
 * and appearing in the file LICENSE.GPL included in the packaging of
 * this file. Please review the following information to ensure the
 * GNU General Public License version 3.0 requirements will be met:
 * http://www.gnu.org/copyleft/gpl.html.
 *
 * Other Usage
 * Alternatively, this file may be used in accordance with the terms
 * and conditions contained in a signed written agreement between
 * you and ecsec GmbH.
 *
 ***************************************************************************/

package org.openecard.richclient.gui.manage;

import java.io.IOException;
import java.util.ArrayList;
import javax.swing.JPanel;
import javax.swing.BoxLayout;


/**
 * Panel aggregating several setting group entries.
 * The entries are of type {@link SettingsGroup}.
 *
 * @author Tobias Wich <tobias.wich@ecsec.de>
 */
public abstract class SettingsPanel extends JPanel {

    private static final long serialVersionUID = 1L;

    private ArrayList<SettingsGroup> groups;

    /**
     * Creates a panel instance.
     */
    public SettingsPanel() {
	this.groups = new ArrayList<SettingsGroup>();
	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    }

    /**
     * Adds a settings group to this panel.
     *
     * @param item The group to add to the panel.
     */
    protected void addSettingsGroup(SettingsGroup item) {
	add(item);
	groups.add(item);
    }

    /**
     * Saves all settings groups of this panel.
     *
     * @throws IOException Thrown in case the properties could not be written to the output device.
     * @throws SecurityException Thrown in case the permission to save the properties is missing.
     */
    public void saveProperties() throws IOException, SecurityException {
	for (SettingsGroup next : groups) {
	    next.saveProperties();
	}
    }

}

@@ -92,16 +92,21 @@
 (C) 2013
+-2014
  ecsec G
@@ -961,107 +961,303 @@
 ava.
-io.IOException;%0Aimport java.util.ArrayList;%0Aimport javax.swing.JPanel;%0Aimport javax.swing.BoxLayout
+awt.GridBagConstraints;%0Aimport java.awt.GridBagLayout;%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport javax.swing.BorderFactory;%0Aimport javax.swing.JPanel;%0Aimport javax.swing.JScrollPane;%0Aimport javax.swing.ScrollPaneConstants;%0Aimport org.openecard.addon.AddonPropertiesException
 ;%0A%0A%0A
@@ -1411,16 +1411,74 @@
 sec.de%3E%0A
+ * @author Hans-Martin Haase %3Chans-martin.haase@ecsec.de%3E%0A
  */%0Apubl
@@ -1593,16 +1593,22 @@
 private 
+final 
 ArrayLis
@@ -1631,16 +1631,69 @@
  groups;
+%0A    private final JPanel contentPane = new JPanel();
 %0A%0A    /*
@@ -1797,268 +1797,1195 @@
 ist%3C
-SettingsGroup%3E();%0A%09setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));%0A    %7D%0A%0A    /**%0A     * Adds a settings group to this panel.%0A     *%0A     * @param item The group to add to the panel.%0A     */%0A    protected void addSettingsGroup(SettingsGroup item) %7B%0A%09
+%3E();%0A%09contentPane.setLayout(new GridBagLayout());%0A%09setLayout(new GridBagLayout());%0A%09GridBagConstraints c = new GridBagConstraints();%0A%09JScrollPane scrollPane = new JScrollPane(contentPane);%0A%09scrollPane.setBorder(BorderFactory.createEmptyBorder());%0A%09scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);%0A%09scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);%0A%09scrollPane.getVerticalScrollBar().setValue(0);%0A%09scrollPane.getVerticalScrollBar().setBlockIncrement(16);%0A%09scrollPane.getVerticalScrollBar().setUnitIncrement(16);%0A%09c.fill = GridBagConstraints.BOTH;%0A%09c.gridwidth = GridBagConstraints.REMAINDER;%0A%09c.weightx = 1.0;%0A%09c.weighty = 1.0;%0A%09c.anchor = GridBagConstraints.NORTHWEST;%0A%09add(scrollPane, c);%0A    %7D%0A%0A    /**%0A     * Adds a settings group to this panel.%0A     *%0A     * @param item The group to add to the panel.%0A     */%0A    protected void addSettingsGroup(SettingsGroup item) %7B%0A%0A%09GridBagConstraints c = new GridBagConstraints();%0A%09c.fill = GridBagConstraints.HORIZONTAL;%0A%09c.gridwidth = GridBagConstraints.REMAINDER;%0A%09c.weightx = 1.0;%0A%09c.weighty = 1.0;%0A%09c.anchor = GridBagConstraints.NORTHWEST;%0A%09contentPane.
 add(item
 );%0A%09
@@ -2980,16 +2980,19 @@
 add(item
+, c
 );%0A%09grou
@@ -3273,16 +3273,168 @@
 issing.%0A
+     * @throws org.openecard.addon.AddonPropertiesException Thrown in case the AddonProperties object throws this%0A     * exception in the store method.%0A
      */%0A
@@ -3503,16 +3503,42 @@
 xception
+, AddonPropertiesException
  %7B%0A%09for 

Put the settings group onto a ScrollPanel.