/* ========================
* JSynoptic : a free Synoptic editor
* ========================
*
* Project Info: http://jsynoptic.sourceforge.net/index.html
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation;
* either version 2.1 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* (C) Copyright 2001-2005, by :
* Corporate:
* EADS Astrium SAS
* EADS CRC
* Individual:
* Claude Cazenave
*
* $Id: SynopticsExportPanel.java,v 1.2 2008/07/22 10:27:38 ogor Exp $
*
* Changes
* -------
* 25 february 2008 : Initial public release (CC);
*
*/
package jsynoptic.plugins.export.ui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import simtools.ui.CheckBoxList;
import simtools.ui.MenuResourceBundle;
import simtools.ui.GridBagPanel;
import simtools.ui.ResourceFinder;
import jsynoptic.plugins.export.SynopticsExportPlugin;
import jsynoptic.ui.FiledDesktopCardPanel;
import jsynoptic.ui.JSynoptic;
/**
* A panel dedicated to configure an archive content.
* @author zxpletran007
*
*/
public class SynopticsExportPanel extends GridBagPanel{
public static MenuResourceBundle resources = ResourceFinder.getMenu(SynopticsExportPlugin.class);
protected CheckBoxList sheetsList;
protected JCheckBox selectAll;
protected JCheckBox includeDependingResources;
public SynopticsExportPanel(){
selectAll = new JCheckBox(resources.getStringValue("selectAll"), false) ;
selectAll.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
sheetsList.checkAll(selectAll.isSelected());
}
});
includeDependingResources = new JCheckBox(resources.getStringValue("includeDependingResources"), true) ;
List sheets = new ArrayList();
FiledDesktopCardPanel cardPanel = JSynoptic.gui.getFilePanel();
if (cardPanel != null){
Iterator it = cardPanel.getComponentIterator();
while(it.hasNext()){
sheets.add(((JComponent)it.next()) );
}
}
sheetsList = new CheckBoxList(sheets);
// sheetsList.setVisibleRowCount(5);
JScrollPane tlistScrollPane = new JScrollPane(sheetsList);
addOnCurrentRow(new JLabel(resources.getString("selectSheets")));
carriageReturn();
addOnCurrentRow(tlistScrollPane, 1, true, true, true);
addOnCurrentRow(selectAll);
carriageReturn();
addOnCurrentRow(includeDependingResources);
carriageReturn();
}
public List getSelectSheet(){
return sheetsList.getCheckedItemsList();
}
public boolean includeDependingResources(){
return includeDependingResources.isSelected();
}
}