class EqualStringPanel extends javax.swing.JPanel implements ActionListener {

    private AttributeEqualBuilder.EqualStringFilter filter;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel labelPattern;
    private javax.swing.JButton okButton;
    private javax.swing.JCheckBox regexCheckbox;
    private javax.swing.JTextField textField;
    // End of variables declaration//GEN-END:variables

    public EqualStringPanel() {
        initComponents();

        okButton.addActionListener(this);
    }

    public static ValidationPanel createValidationPanel(final EqualStringPanel innerPanel) {
        final ValidationPanel validationPanel = new ValidationPanel();
        validationPanel.setInnerComponent(innerPanel);

        ValidationGroup group = validationPanel.getValidationGroup();
        validationPanel.addChangeListener(new ChangeListener() {

            @Override
            public void stateChanged(ChangeEvent e) {
                innerPanel.okButton.setEnabled(!validationPanel.isFatalProblem());
            }
        });
        //Node field
        group.add(innerPanel.textField, new RegexValidator(innerPanel));

        return validationPanel;
    }

    @Override
    public void actionPerformed(ActionEvent evt) {<FILL_FUNCTION_BODY>}

    public void setup(AttributeEqualBuilder.EqualStringFilter filter) {
        this.filter = filter;
        this.setToolTipText(filter.getName() + " '" + filter.getColumn().getTitle() + "'");
        FilterProperty pattern = filter.getProperties()[1];
        FilterProperty useRegex = filter.getProperties()[2];
        try {
            textField.setText((String) pattern.getValue());
            regexCheckbox.setSelected((Boolean) useRegex.getValue());
        } catch (Exception e) {
            Exceptions.printStackTrace(e);
        }
    }

    /**
     * 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() {
        java.awt.GridBagConstraints gridBagConstraints;

        labelPattern = new javax.swing.JLabel();
        textField = new javax.swing.JTextField();
        regexCheckbox = new javax.swing.JCheckBox();
        okButton = new javax.swing.JButton();

        setOpaque(false);
        setLayout(new java.awt.GridBagLayout());

        labelPattern.setText(org.openide.util.NbBundle
            .getMessage(EqualStringPanel.class, "EqualStringPanel.labelPattern.text")); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 3);
        add(labelPattern, gridBagConstraints);

        textField.setText(
            org.openide.util.NbBundle.getMessage(EqualStringPanel.class, "EqualStringPanel.textField.text")); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.weightx = 1.0;
        add(textField, gridBagConstraints);

        regexCheckbox.setText(org.openide.util.NbBundle
            .getMessage(EqualStringPanel.class, "EqualStringPanel.regexCheckbox.text")); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        add(regexCheckbox, gridBagConstraints);

        okButton.setText(
            org.openide.util.NbBundle.getMessage(EqualStringPanel.class, "EqualStringPanel.okButton.text")); // NOI18N
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 3);
        add(okButton, gridBagConstraints);
    }// </editor-fold>//GEN-END:initComponents

    private static class RegexValidator implements Validator<String> {

        private final EqualStringPanel panel;

        public RegexValidator(EqualStringPanel panel) {
            this.panel = panel;
        }

        @Override
        public Class<String> modelType() {
            return String.class;
        }

        @Override
        public void validate(Problems problems, String compName, String model) {
            boolean result = true;
            if (panel.regexCheckbox.isSelected()) {
                try {
                    Pattern p = Pattern.compile(model);
                } catch (Exception e) {
                    result = false;
                }
                if (!result) {
                    String message = "Invalid regex";
                    problems.add(message);
                }
            }
        }
    }
}

        FilterProperty pattern = filter.getProperties()[1];
        FilterProperty useRegex = filter.getProperties()[2];
        try {
            if (pattern.getValue() == null || !pattern.getValue().equals(textField.getText())) {
                pattern.setValue(textField.getText());
            }
            if (useRegex.getValue() == null || !useRegex.getValue().equals(regexCheckbox.isSelected())) {
                useRegex.setValue(regexCheckbox.isSelected());
            }
        } catch (Exception e) {
            Exceptions.printStackTrace(e);
        }
    
<methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void setUI(javax.swing.plaf.PanelUI) ,public void updateUI() <variables>private static final java.lang.String uiClassID