--- /dev/null
+/*
+ * Copyright
+ * 2012 axYus - http://www.axyus.com
+ * 2012 C.Marchand - christophe.marchand@axyus.com
+ *
+ * This file is part of XEMELIOS_NB.
+ *
+ * XEMELIOS_NB 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 of the License, or
+ * (at your option) any later version.
+ *
+ * XEMELIOS_NB 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 XEMELIOS_NB; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+package fr.gouv.finances.cp.buildtools.persist.ora.ihm;
+
+/**
+ *
+ * @author cmarchand
+ */
+public class PnlEditSql extends javax.swing.JPanel {
+ private OraGenFrame.SqlNode sql;
+
+ /** Creates new form PnlEditSql */
+ public PnlEditSql(OraGenFrame.SqlNode sql) {
+ initComponents();
+ this.sql = sql;
+ dfDesc.setText(sql.getDesc());
+ mlCode.setText(sql.getCode());
+ dfDesc.getDocument().addDocumentListener(new PnlEditColumn.TextFieldBinder() {
+ @Override
+ public void setData(String text) {
+ PnlEditSql.this.sql.setDesc(text);
+ }
+ });
+ mlCode.getDocument().addDocumentListener(new PnlEditColumn.TextFieldBinder() {
+ @Override
+ public void setData(String text) {
+ PnlEditSql.this.sql.setCode(text);
+ }
+ });
+ dfRank.setDocument(new OraGenFrame.NumberFilteredField());
+ dfRank.getDocument().addDocumentListener(new PnlEditColumn.TextFieldBinder() {
+ @Override
+ public void setData(String text) {
+ try {
+ int i = Integer.parseInt(text);
+ PnlEditSql.this.sql.setRank(i);
+ } catch(Throwable t) {}
+ }
+ });
+ dfRank.setText(Integer.toString(sql.getRank()));
+ }
+
+ /** 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() {
+
+ jLabel1 = new javax.swing.JLabel();
+ dfDesc = new javax.swing.JTextField();
+ jLabel2 = new javax.swing.JLabel();
+ jScrollPane1 = new javax.swing.JScrollPane();
+ mlCode = new javax.swing.JTextArea();
+ pbDelete = new javax.swing.JButton();
+ jLabel3 = new javax.swing.JLabel();
+ dfRank = new javax.swing.JTextField();
+
+ jLabel1.setText("Description");
+
+ jLabel2.setText("Code");
+
+ mlCode.setColumns(20);
+ mlCode.setRows(5);
+ jScrollPane1.setViewportView(mlCode);
+
+ pbDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fr/gouv/finances/cp/buildtools/persist/ora/ihm/deleteRow.png"))); // NOI18N
+ pbDelete.setToolTipText("Supprimer ce code SQL");
+
+ jLabel3.setText("Rang");
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jLabel1)
+ .addComponent(jLabel2)
+ .addComponent(jLabel3))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE)
+ .addComponent(dfDesc, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(dfRank, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 204, Short.MAX_VALUE)
+ .addComponent(pbDelete)))
+ .addContainerGap())
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel1)
+ .addComponent(dfDesc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jLabel2))
+ .addGroup(layout.createSequentialGroup()
+ .addGap(15, 15, 15)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(dfRank, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(jLabel3))
+ .addComponent(pbDelete))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextField dfDesc;
+ private javax.swing.JTextField dfRank;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JTextArea mlCode;
+ private javax.swing.JButton pbDelete;
+ // End of variables declaration//GEN-END:variables
+
+}