PageRenderTime 384ms CodeModel.GetById 151ms app.highlight 13ms RepoModel.GetById 218ms app.codeStats 0ms

/src/mpv5/ui/dialogs/subcomponents/wizard_CSVImport_1.java

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
Java | 115 lines | 90 code | 18 blank | 7 comment | 2 complexity | c9411deee43cedc77146e10165188b8e MD5 | raw file
  1package mpv5.ui.dialogs.subcomponents;
  2
  3import mpv5.ui.dialogs.DialogForFile;
  4import mpv5.ui.dialogs.WizardMaster;
  5import mpv5.ui.dialogs.Wizardable;
  6
  7/**
  8 *
  9 * 
 10 */
 11public class wizard_CSVImport_1 extends javax.swing.JPanel implements Wizardable {
 12
 13    private static final long serialVersionUID = -8347532498124147821L;
 14    private WizardMaster master;
 15
 16    public wizard_CSVImport_1(WizardMaster w) {
 17        this.master = w;
 18        initComponents();
 19        labeledTextChooser1.setFilter(DialogForFile.CSV_FILES);
 20        jComboBox1.setSelectedIndex(0);
 21        labeledTextChooser1.setModalityParent(this);
 22    }
 23
 24    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
 25    private void initComponents() {
 26
 27        buttonGroup1 = new javax.swing.ButtonGroup();
 28        jPanel1 = new javax.swing.JPanel();
 29        labeledTextChooser1 = new mpv5.ui.beans.LabeledTextChooser();
 30        jLabel1 = new javax.swing.JLabel();
 31        jComboBox1 = new javax.swing.JComboBox();
 32        jLabel3 = new javax.swing.JLabel();
 33
 34        setBackground(new java.awt.Color(255, 255, 255));
 35        setName("Form"); // NOI18N
 36        setLayout(new java.awt.BorderLayout());
 37
 38        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
 39        java.util.ResourceBundle bundle = mpv5.i18n.LanguageManager.getBundle(); // NOI18N
 40        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("wizard_CSVImport_1.jPanel1.border.title"))); // NOI18N
 41        jPanel1.setName("jPanel1"); // NOI18N
 42
 43        labeledTextChooser1.set_Label(bundle.getString("wizard_CSVImport_1.labeledTextChooser1._Label")); // NOI18N
 44        labeledTextChooser1.setName("labeledTextChooser1"); // NOI18N
 45
 46        jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() & ~java.awt.Font.BOLD));
 47        jLabel1.setText(bundle.getString("wizard_CSVImport_1.jLabel1.text")); // NOI18N
 48        jLabel1.setName("jLabel1"); // NOI18N
 49
 50        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { ";", ",", "##&&" }));
 51        jComboBox1.setName("jComboBox1"); // NOI18N
 52
 53        jLabel3.setFont(jLabel3.getFont().deriveFont(jLabel3.getFont().getStyle() & ~java.awt.Font.BOLD));
 54        jLabel3.setText(bundle.getString("wizard_CSVImport_1.jLabel3.text")); // NOI18N
 55        jLabel3.setName("jLabel3"); // NOI18N
 56
 57        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
 58        jPanel1.setLayout(jPanel1Layout);
 59        jPanel1Layout.setHorizontalGroup(
 60            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 61            .addGroup(jPanel1Layout.createSequentialGroup()
 62                .addContainerGap()
 63                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 64                    .addGroup(jPanel1Layout.createSequentialGroup()
 65                        .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)
 66                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 67                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
 68                    .addComponent(labeledTextChooser1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)
 69                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE))
 70                .addContainerGap())
 71        );
 72        jPanel1Layout.setVerticalGroup(
 73            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 74            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
 75                .addContainerGap(117, Short.MAX_VALUE)
 76                .addComponent(jLabel1)
 77                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 78                .addComponent(labeledTextChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 79                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 80                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 81                    .addComponent(jLabel3)
 82                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
 83                .addContainerGap())
 84        );
 85
 86        add(jPanel1, java.awt.BorderLayout.CENTER);
 87    }// </editor-fold>//GEN-END:initComponents
 88    // Variables declaration - do not modify//GEN-BEGIN:variables
 89    private javax.swing.ButtonGroup buttonGroup1;
 90    private javax.swing.JComboBox jComboBox1;
 91    private javax.swing.JLabel jLabel1;
 92    private javax.swing.JLabel jLabel3;
 93    private javax.swing.JPanel jPanel1;
 94    private mpv5.ui.beans.LabeledTextChooser labeledTextChooser1;
 95    // End of variables declaration//GEN-END:variables
 96
 97    public boolean next() {
 98        if (labeledTextChooser1.hasText()) {
 99            master.getStore().addProperty("file", labeledTextChooser1.get_Text(true));
100            master.getStore().addProperty("separator", jComboBox1.getSelectedItem().toString());
101            master.getNext().load();
102            return true;
103        } else {
104            return false;
105        }
106    }
107
108    public boolean back() {
109        return false;
110    }
111
112    public void load() {
113
114    }
115}