package fr.gouv.finances.cp.buildtools.components;
import java.util.ArrayList;
+
import javax.swing.DefaultListModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
/**
* La liste des composants
+ *
* @author cmarchand
*/
public class PnlComponentList extends javax.swing.JPanel {
- private static final ArrayList<Component> components = new ArrayList<Component>();
- static {
- components.add(new Component("src/api-plugin"));
- components.add(new Component("src/auth-aphm"));
- components.add(new Component("src/auth-basic"));
- components.add(new Component("src/auth-dgcp"));
- components.add(new Component("src/auth-ldap"));
- components.add(new Component("src/auth-noauth"));
- components.add(new Component("src/auth-std-db"));
- components.add(new Component("src/bourses"));
- components.add(new Component("src/carte-achat"));
- components.add(new Component("src/cfg-paye"));
- components.add(new Component("src/cg-colloc"));
- components.add(new Component("src/cg-etat"));
- components.add(new Component("src/control-core"));
- components.add(new Component("src/core"));
- components.add(new Component("src/doc-budg"));
- components.add(new Component("src/edmn"));
- components.add(new Component("src/erar"));
- components.add(new Component("src/etat-frais"));
- components.add(new Component("src/etat-frais-spl"));
- components.add(new Component("src/facture-depense"));
- components.add(new Component("src/facture-recette"));
- components.add(new Component("src/generator-pes-pj"));
- components.add(new Component("src/import-batch"));
- components.add(new Component("src/manifeste"));
- components.add(new Component("src/mysql-maintenance"));
- components.add(new Component("src/mysql-persistence"));
- components.add(new Component("src/pes-aller"));
- components.add(new Component("src/pes-facture"));
- components.add(new Component("src/quittancement"));
- components.add(new Component("src/rapport"));
- components.add(new Component("src/re-patch-tables"));
- components.add(new Component("src/ref-collec-spl"));
- components.add(new Component("src/rsa"));
- components.add(new Component("http://xemelios.org/updatesV5/signature","signature"));
- components.add(new Component("src/starter"));
- components.add(new Component("src/swing-utils"));
- components.add(new Component("src/user-guide"));
- components.add(new Component("src/versement"));
- components.add(new Component("src/xemelios-core"));
- components.add(new Component("src/xml-marshall"));
- }
+ private static final ArrayList<Component> components = new ArrayList<Component>();
+ static {
+ PnlComponentList.components.add(new Component("src/api-plugin"));
+ PnlComponentList.components.add(new Component("src/auth-aphm"));
+ PnlComponentList.components.add(new Component("src/auth-basic"));
+ PnlComponentList.components.add(new Component("src/auth-dgcp"));
+ PnlComponentList.components.add(new Component("src/auth-ldap"));
+ PnlComponentList.components.add(new Component("src/auth-noauth"));
+ PnlComponentList.components.add(new Component("src/auth-std-db"));
+ PnlComponentList.components.add(new Component("src/bourses"));
+ PnlComponentList.components.add(new Component("src/carte-achat"));
+ PnlComponentList.components.add(new Component("src/cfg-paye"));
+ PnlComponentList.components.add(new Component("src/cg-colloc"));
+ PnlComponentList.components.add(new Component("src/cg-etat"));
+ PnlComponentList.components.add(new Component("src/control-core"));
+ PnlComponentList.components.add(new Component("src/core"));
+ PnlComponentList.components.add(new Component("src/doc-budg"));
+ PnlComponentList.components.add(new Component("src/edmn"));
+ PnlComponentList.components.add(new Component("src/edmn-2012"));
+ PnlComponentList.components.add(new Component("src/erar"));
+ PnlComponentList.components.add(new Component("src/etat-frais"));
+ PnlComponentList.components.add(new Component("src/etat-frais-spl"));
+ PnlComponentList.components.add(new Component("src/facture-depense"));
+ PnlComponentList.components.add(new Component("src/facture-recette"));
+ PnlComponentList.components.add(new Component("src/generator-pes-pj"));
+ PnlComponentList.components.add(new Component("src/import-batch"));
+ PnlComponentList.components.add(new Component("src/manifeste"));
+ PnlComponentList.components.add(new Component("src/mysql-maintenance"));
+ PnlComponentList.components.add(new Component("src/mysql-persistence"));
+ PnlComponentList.components.add(new Component("src/pes-aller"));
+ PnlComponentList.components.add(new Component("src/pes-facture"));
+ PnlComponentList.components.add(new Component("src/quittancement"));
+ PnlComponentList.components.add(new Component("src/rapport"));
+ PnlComponentList.components.add(new Component("src/re-patch-tables"));
+ PnlComponentList.components.add(new Component("src/ref-collec-spl"));
+ PnlComponentList.components.add(new Component("src/rsa"));
+ PnlComponentList.components.add(new Component("http://xemelios.org/updatesV5/signature", "signature"));
+ PnlComponentList.components.add(new Component("src/starter"));
+ PnlComponentList.components.add(new Component("src/swing-utils"));
+ PnlComponentList.components.add(new Component("src/user-guide"));
+ PnlComponentList.components.add(new Component("src/versement"));
+ PnlComponentList.components.add(new Component("src/xemelios-core"));
+ PnlComponentList.components.add(new Component("src/xml-marshall"));
+ }
- private DlgManageComponents parent;
+ private DlgManageComponents parent;
- /** Creates new form PnlComponentList */
- public PnlComponentList(DlgManageComponents parent) {
- super();
- this.parent=parent;
- initComponents();
- lstComponents.addListSelectionListener(new ListSelectionListener() {
- @Override
- public void valueChanged(ListSelectionEvent e) {
- if(!e.getValueIsAdjusting())
- PnlComponentList.this.parent.componentSelectedChanged();
- }
- });
- }
+ /** Creates new form PnlComponentList */
+ public PnlComponentList(final DlgManageComponents parent) {
+ super();
+ this.parent = parent;
+ this.initComponents();
+ this.lstComponents.addListSelectionListener(new ListSelectionListener() {
+ @Override
+ public void valueChanged(final ListSelectionEvent e) {
+ if (!e.getValueIsAdjusting()) {
+ PnlComponentList.this.parent.componentSelectedChanged();
+ }
+ }
+ });
+ }
+ /**
+ * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
- private void initComponents() {
+ this.jLabel1 = new javax.swing.JLabel();
+ this.jScrollPane1 = new javax.swing.JScrollPane();
+ this.lstComponents = new javax.swing.JList();
- jLabel1 = new javax.swing.JLabel();
- jScrollPane1 = new javax.swing.JScrollPane();
- lstComponents = new javax.swing.JList();
+ this.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
- setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
+ this.jLabel1.setText("Composants");
- jLabel1.setText("Composants");
+ this.lstComponents.setModel(new ComponentListModel(PnlComponentList.components));
+ this.lstComponents.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
+ this.jScrollPane1.setViewportView(this.lstComponents);
- lstComponents.setModel(new ComponentListModel(components));
- lstComponents.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
- jScrollPane1.setViewportView(lstComponents);
+ final javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(this.jLabel1).addContainerGap(193, Short.MAX_VALUE))
+ .addComponent(this.jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE));
+ layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
+ layout.createSequentialGroup().addComponent(this.jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(this.jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE)));
+ }// </editor-fold>//GEN-END:initComponents
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
- this.setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(jLabel1)
- .addContainerGap(193, Short.MAX_VALUE))
- .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(jLabel1)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE))
- );
- }// </editor-fold>//GEN-END:initComponents
+ protected Component getSelectedComponent() {
+ return (Component) this.lstComponents.getSelectedValue();
+ }
- protected Component getSelectedComponent() { return (Component)lstComponents.getSelectedValue(); }
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JList lstComponents;
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JLabel jLabel1;
- private javax.swing.JScrollPane jScrollPane1;
- private javax.swing.JList lstComponents;
- // End of variables declaration//GEN-END:variables
+ // End of variables declaration//GEN-END:variables
- private class ComponentListModel extends DefaultListModel {
- public ComponentListModel(ArrayList<Component> comps) {
- super();
- for(Component c:comps) addElement(c);
- }
- }
+ private class ComponentListModel extends DefaultListModel {
+ public ComponentListModel(final ArrayList<Component> comps) {
+ super();
+ for (final Component c : comps) {
+ this.addElement(c);
+ }
+ }
+ }
}