001: /*
002: * XmlOptionsPanel.java
003: *
004: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
005: *
006: * Copyright 2002-2008, Thomas Kellerer
007: * No part of this code maybe reused without the permission of the author
008: *
009: * To contact the author please send an email to: support@sql-workbench.net
010: *
011: */
012: package workbench.gui.dialogs.export;
013:
014: import workbench.resource.ResourceMgr;
015: import workbench.resource.Settings;
016: import workbench.gui.dialogs.export.XmlOptions;
017:
018: /**
019: *
020: * @author support@sql-workbench.net
021: */
022: public class XmlOptionsPanel extends javax.swing.JPanel implements
023: XmlOptions {
024:
025: /** Creates new form XmlOptionsPanel */
026: public XmlOptionsPanel() {
027: initComponents();
028: }
029:
030: public void saveSettings() {
031: Settings s = Settings.getInstance();
032: s.setProperty("workbench.export.xml.usecdata", this
033: .getUseCDATA());
034: s.setProperty("workbench.export.xml.verbosexml", this
035: .getUseVerboseXml());
036: }
037:
038: public void restoreSettings() {
039: Settings s = Settings.getInstance();
040: this .setUseCDATA(s
041: .getBoolProperty("workbench.export.xml.usecdata"));
042: this .setUseVerboseXml(s.getBoolProperty(
043: "workbench.export.xml.verbosexml", true));
044: }
045:
046: public boolean getUseVerboseXml() {
047: return this .verboseXmlCheckBox.isSelected();
048: }
049:
050: public void setUseVerboseXml(boolean flag) {
051: this .verboseXmlCheckBox.setSelected(flag);
052: }
053:
054: public boolean getUseCDATA() {
055: return useCdata.isSelected();
056: }
057:
058: public void setUseCDATA(boolean flag) {
059: useCdata.setSelected(flag);
060: }
061:
062: /** This method is called from within the constructor to
063: * initialize the form.
064: * WARNING: Do NOT modify this code. The content of this method is
065: * always regenerated by the Form Editor.
066: */
067: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
068: private void initComponents() {
069: java.awt.GridBagConstraints gridBagConstraints;
070:
071: useCdata = new javax.swing.JCheckBox();
072: verboseXmlCheckBox = new javax.swing.JCheckBox();
073:
074: setLayout(new java.awt.GridBagLayout());
075:
076: useCdata.setText(ResourceMgr.getString("LblExportUseCDATA"));
077: gridBagConstraints = new java.awt.GridBagConstraints();
078: gridBagConstraints.gridx = 0;
079: gridBagConstraints.gridy = 0;
080: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
081: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
082: add(useCdata, gridBagConstraints);
083:
084: verboseXmlCheckBox.setText(ResourceMgr
085: .getString("LblExportVerboseXml"));
086: verboseXmlCheckBox.setToolTipText(ResourceMgr
087: .getDescription("LblExportVerboseXml"));
088: gridBagConstraints = new java.awt.GridBagConstraints();
089: gridBagConstraints.gridx = 0;
090: gridBagConstraints.gridy = 1;
091: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
092: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
093: gridBagConstraints.weightx = 1.0;
094: gridBagConstraints.weighty = 1.0;
095: add(verboseXmlCheckBox, gridBagConstraints);
096:
097: }
098:
099: // </editor-fold>//GEN-END:initComponents
100:
101: // Variables declaration - do not modify//GEN-BEGIN:variables
102: private javax.swing.JCheckBox useCdata;
103: private javax.swing.JCheckBox verboseXmlCheckBox;
104: // End of variables declaration//GEN-END:variables
105:
106: }
|