/** * WS-Attacker - A Modular Web Services Penetration Testing Framework Copyright * (C) 2010 Christian Mainka * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program 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 General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package wsattacker.gui.component.pluginconfiguration.option; import wsattacker.gui.component.pluginconfiguration.composition.OptionGUI; import wsattacker.main.composition.plugin.option.AbstractOption; import wsattacker.main.composition.plugin.option.AbstractOptionBoolean; import wsattacker.main.plugin.option.OptionSimpleBoolean; public class OptionBooleanGUI_NB extends OptionGUI { public static final String PROP_OPTIONBOOLEAN = "optionBoolean"; private AbstractOptionBoolean optionBoolean = new OptionSimpleBoolean( "Sample Option", true, "Sample Description" ); public OptionBooleanGUI_NB() { initComponents(); } public OptionBooleanGUI_NB( AbstractOptionBoolean optionBoolean ) { this.optionBoolean = optionBoolean; initComponents(); } /** * Get the value of optionBoolean * * @return the value of optionBoolean */ public AbstractOptionBoolean getOptionBoolean() { return optionBoolean; } /** * Set the value of optionBoolean * * @param optionBoolean new value of optionBoolean */ public void setOptionBoolean( AbstractOptionBoolean optionBoolean ) { AbstractOptionBoolean oldOptionBoolean = this.optionBoolean; this.optionBoolean = optionBoolean; firePropertyChange( PROP_OPTIONBOOLEAN, oldOptionBoolean, optionBoolean ); } /** * 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() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); name = new javax.swing.JLabel(); on = new javax.swing.JCheckBox(); name.setFont( new java.awt.Font( "Dialog", 1, 18 ) ); // NOI18N org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, this, org.jdesktop.beansbinding.ELProperty.create( "${optionBoolean.name}" ), name, org.jdesktop.beansbinding.BeanProperty.create( "text" ) ); binding.setSourceNullValue( "Option Name" ); binding.setSourceUnreadableValue( "Option Name" ); bindingGroup.addBinding( binding ); on.setFont( new java.awt.Font( "Dialog", 0, 12 ) ); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create( "${optionBoolean.on}" ), on, org.jdesktop.beansbinding.BeanProperty.create( "selected" ) ); bindingGroup.addBinding( binding ); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ, this, org.jdesktop.beansbinding.ELProperty.create( "${optionBoolean.description}" ), on, org.jdesktop.beansbinding.BeanProperty.create( "label" ) ); binding.setSourceNullValue( "Option Description" ); binding.setSourceUnreadableValue( "Option Description" ); bindingGroup.addBinding( binding ); 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( name, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE ).addComponent( on, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE ) ).addContainerGap() ) ); layout.setVerticalGroup( layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING ).addGroup( layout.createSequentialGroup().addContainerGap().addComponent( name ).addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED ).addComponent( on ).addContainerGap( javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE ) ) ); bindingGroup.bind(); }// </editor-fold>//GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel name; private javax.swing.JCheckBox on; private org.jdesktop.beansbinding.BindingGroup bindingGroup; // End of variables declaration//GEN-END:variables @Override public void bindingDoUnbind() { bindingGroup.unbind(); } @Override public AbstractOption getUsedOption() { return optionBoolean; } }