PageRenderTime 153ms CodeModel.GetById 71ms app.highlight 9ms RepoModel.GetById 71ms app.codeStats 0ms

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

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