text:
package io.github.jeddict.jpa.modeler.properties.validation;

import javax.swing.DefaultComboBoxModel;
import io.github.jeddict.jpa.spec.JoinColumn;
import org.netbeans.modeler.properties.EntityComponent;
import org.netbeans.modeler.properties.spec.Entity;
import org.netbeans.modeler.properties.spec.RowValue;
import org.netbeans.modeler.properties.customattr.Property;

public class BeanValidationPanel extends EntityComponent<JoinColumn> {

    @Override
    public void postConstruct() {
        initComponents();
        validation_ComboBox.removeAllItems();
        Property[] validationProperties = new Property[]{
            new Property("ASSERT_TRUE", "Assert True"),
            new Property("ASSERT_FALSE", "Assert False"),
            new Property("DECIMAL_MAX", "Decimal Max"),
            new Property("DECIMAL_MIN", "Decimal Min"),
            new Property("MAX", "Max"),
            new Property("MIN", "Min"),
            new Property("FUTURE", "Future"),
            new Property("PAST", "Past"),
            new Property("NOT_NULL", "NotNull"),
            new Property("NULL", "Null"),
            new Property("PATTERN", "Pattern"),
            new Property("SIZE", "Size"),
            new Property("DIGITS", "Digits")
        };
        validation_ComboBox.setModel(new DefaultComboBoxModel(validationProperties));
    }

    @Override
    public void init() {
    }

    @Override
    public void createEntity(Class<? extends Entity> entityWrapperType) {
        this.setTitle("Create new Validation");
        if (entityWrapperType == RowValue.class) {
            this.setEntity(new RowValue(new Object[4]));
        }
//        name_TextField.setText("");
//        referencedColumnName_TextField.setText("");
//        table_TextField.setText("");
//        columnDefinition_TextArea.setText("");
//        unique_CheckBox.setSelected(false);
//        nullable_CheckBox.setSelected(true);
//        insertable_CheckBox.setSelected(true);
//        updatable_CheckBox.setSelected(true);
    }

    @Override
    public void updateEntity(Entity<JoinColumn> entityValue) {
        this.setTitle("Update Validation");
        if (entityValue.getClass() == RowValue.class) {
            this.setEntity(entityValue);
            Object[] row = ((RowValue) entityValue).getRow();
            JoinColumn joinColumn = (JoinColumn) row[0];
//            name_TextField.setText(joinColumn.getName());
//            referencedColumnName_TextField.setText(joinColumn.getReferencedColumnName());
//            table_TextField.setText(joinColumn.getTable());
//            columnDefinition_TextArea.setText(joinColumn.getColumnDefinition());
//            unique_CheckBox.setSelected(joinColumn.isUnique());
//            nullable_CheckBox.setSelected(joinColumn.isNullable());
//            insertable_CheckBox.setSelected(joinColumn.isInsertable());
//            updatable_CheckBox.setSelected(joinColumn.isUpdatable());

        }
    }

    /**
     * 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;

        jLayeredPane1 = new javax.swing.JLayeredPane();
        validation_LayeredPane = new javax.swing.JLayeredPane();
        validation_Label = new javax.swing.JLabel();
        validation_ComboBox = new javax.swing.JComboBox();
        max_LayeredPane = new javax.swing.JLayeredPane();
        max_Label = new javax.swing.JLabel();
        max_Spinner = new javax.swing.JSpinner();
        min_LayeredPane = new javax.swing.JLayeredPane();
        min_Label = new javax.swing.JLabel();
        min_Spinner = new javax.swing.JSpinner();
        integer_LayeredPane = new javax.swing.JLayeredPane();
        integer_Label = new javax.swing.JLabel();
        integer_Spinner = new javax.swing.JSpinner();
        fraction_LayeredPane = new javax.swing.JLayeredPane();
        fraction_Label = new javax.swing.JLabel();
        fraction_Spinner = new javax.swing.JSpinner();
        regex_LayeredPane = new javax.swing.JLayeredPane();
        regex_Label = new javax.swing.JLabel();
        regex_TextField = new javax.swing.JTextField();
        message_LayeredPane = new javax.swing.JLayeredPane();
        message_Label = new javax.swing.JLabel();
        message_ScrollPane = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        action_LayeredPane = new javax.swing.JLayeredPane();
        save_Button = new javax.swing.JButton();
        cancel_Button = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jLayeredPane1.setPreferredSize(new java.awt.Dimension(340, 372));
        jLayeredPane1.setLayout(new java.awt.GridBagLayout());

        org.openide.awt.Mnemonics.setLocalizedText(validation_Label, org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.validation_Label.text")); // NOI18N

        validation_ComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                validation_ComboBoxActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout validation_LayeredPaneLayout = new javax.swing.GroupLayout(validation_LayeredPane);
        validation_LayeredPane.setLayout(validation_LayeredPaneLayout);
        validation_LayeredPaneLayout.setHorizontalGroup(
            validation_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(validation_LayeredPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(validation_Label, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(validation_ComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        validation_LayeredPaneLayout.setVerticalGroup(
            validation_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(validation_LayeredPaneLayout.createSequentialGroup()
                .addGroup(validation_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(validation_Label)
                    .addComponent(validation_ComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        validation_LayeredPane.setLayer(validation_Label, javax.swing.JLayeredPane.DEFAULT_LAYER);
        validation_LayeredPane.setLayer(validation_ComboBox, javax.swing.JLayeredPane.DEFAULT_LAYER);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 350;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 10, 0, 10);
        jLayeredPane1.add(validation_LayeredPane, gridBagConstraints);

        org.openide.awt.Mnemonics.setLocalizedText(max_Label, org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.max_Label.text")); // NOI18N

        javax.swing.GroupLayout max_LayeredPaneLayout = new javax.swing.GroupLayout(max_LayeredPane);
        max_LayeredPane.setLayout(max_LayeredPaneLayout);
        max_LayeredPaneLayout.setHorizontalGroup(
            max_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(max_LayeredPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(max_Label, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(max_Spinner)
                .addContainerGap())
        );
        max_LayeredPaneLayout.setVerticalGroup(
            max_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(max_LayeredPaneLayout.createSequentialGroup()
                .addGroup(max_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(max_Label)
                    .addComponent(max_Spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );
        max_LayeredPane.setLayer(max_Label, javax.swing.JLayeredPane.DEFAULT_LAYER);
        max_LayeredPane.setLayer(max_Spinner, javax.swing.JLayeredPane.DEFAULT_LAYER);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 321;
        gridBagConstraints.ipady = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(10, 10, 0, 10);
        jLayeredPane1.add(max_LayeredPane, gridBagConstraints);

        org.openide.awt.Mnemonics.setLocalizedText(min_Label, org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.min_Label.text")); // NOI18N

        javax.swing.GroupLayout min_LayeredPaneLayout = new javax.swing.GroupLayout(min_LayeredPane);
        min_LayeredPane.setLayout(min_LayeredPaneLayout);
        min_LayeredPaneLayout.setHorizontalGroup(
            min_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(min_LayeredPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(min_Label, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(min_Spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(201, Short.MAX_VALUE))
        );
        min_LayeredPaneLayout.setVerticalGroup(
            min_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(min_LayeredPaneLayout.createSequentialGroup()
                .addGroup(min_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(min_Label)
                    .addComponent(min_Spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        min_LayeredPane.setLayer(min_Label, javax.swing.JLayeredPane.DEFAULT_LAYER);
        min_LayeredPane.setLayer(min_Spinner, javax.swing.JLayeredPane.DEFAULT_LAYER);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.ipadx = 321;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 10, 0, 10);
        jLayeredPane1.add(min_LayeredPane, gridBagConstraints);

        org.openide.awt.Mnemonics.setLocalizedText(integer_Label, org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.integer_Label.text")); // NOI18N

        javax.swing.GroupLayout integer_LayeredPaneLayout = new javax.swing.GroupLayout(integer_LayeredPane);
        integer_LayeredPane.setLayout(integer_LayeredPaneLayout);
        integer_LayeredPaneLayout.setHorizontalGroup(
            integer_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(integer_LayeredPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(integer_Label, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(integer_Spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(201, Short.MAX_VALUE))
        );
        integer_LayeredPaneLayout.setVerticalGroup(
            integer_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(integer_LayeredPaneLayout.createSequentialGroup()
                .addGroup(integer_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(integer_Label)
                    .addComponent(integer_Spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        integer_LayeredPane.setLayer(integer_Label, javax.swing.JLayeredPane.DEFAULT_LAYER);
        integer_LayeredPane.setLayer(integer_Spinner, javax.swing.JLayeredPane.DEFAULT_LAYER);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.ipadx = 321;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 10, 0, 10);
        jLayeredPane1.add(integer_LayeredPane, gridBagConstraints);

        org.openide.awt.Mnemonics.setLocalizedText(fraction_Label, org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.fraction_Label.text")); // NOI18N

        javax.swing.GroupLayout fraction_LayeredPaneLayout = new javax.swing.GroupLayout(fraction_LayeredPane);
        fraction_LayeredPane.setLayout(fraction_LayeredPaneLayout);
        fraction_LayeredPaneLayout.setHorizontalGroup(
            fraction_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fraction_LayeredPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(fraction_Label, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(fraction_Spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(201, Short.MAX_VALUE))
        );
        fraction_LayeredPaneLayout.setVerticalGroup(
            fraction_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fraction_LayeredPaneLayout.createSequentialGroup()
                .addGroup(fraction_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(fraction_Label)
                    .addComponent(fraction_Spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        fraction_LayeredPane.setLayer(fraction_Label, javax.swing.JLayeredPane.DEFAULT_LAYER);
        fraction_LayeredPane.setLayer(fraction_Spinner, javax.swing.JLayeredPane.DEFAULT_LAYER);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.ipadx = 321;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 10, 0, 10);
        jLayeredPane1.add(fraction_LayeredPane, gridBagConstraints);

        org.openide.awt.Mnemonics.setLocalizedText(regex_Label, org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.regex_Label.text")); // NOI18N

        regex_TextField.setText(org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.regex_TextField.text")); // NOI18N

        javax.swing.GroupLayout regex_LayeredPaneLayout = new javax.swing.GroupLayout(regex_LayeredPane);
        regex_LayeredPane.setLayout(regex_LayeredPaneLayout);
        regex_LayeredPaneLayout.setHorizontalGroup(
            regex_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(regex_LayeredPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(regex_Label, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(regex_TextField)
                .addContainerGap())
        );
        regex_LayeredPaneLayout.setVerticalGroup(
            regex_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(regex_LayeredPaneLayout.createSequentialGroup()
                .addGroup(regex_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(regex_Label)
                    .addComponent(regex_TextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );
        regex_LayeredPane.setLayer(regex_Label, javax.swing.JLayeredPane.DEFAULT_LAYER);
        regex_LayeredPane.setLayer(regex_TextField, javax.swing.JLayeredPane.DEFAULT_LAYER);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.ipadx = 344;
        gridBagConstraints.ipady = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 10, 0, 10);
        jLayeredPane1.add(regex_LayeredPane, gridBagConstraints);

        org.openide.awt.Mnemonics.setLocalizedText(message_Label, org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.message_Label.text")); // NOI18N

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        message_ScrollPane.setViewportView(jTextArea1);

        javax.swing.GroupLayout message_LayeredPaneLayout = new javax.swing.GroupLayout(message_LayeredPane);
        message_LayeredPane.setLayout(message_LayeredPaneLayout);
        message_LayeredPaneLayout.setHorizontalGroup(
            message_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(message_LayeredPaneLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(message_Label, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(message_ScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
                .addContainerGap())
        );
        message_LayeredPaneLayout.setVerticalGroup(
            message_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(message_LayeredPaneLayout.createSequentialGroup()
                .addGroup(message_LayeredPaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(message_Label)
                    .addGroup(message_LayeredPaneLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(message_ScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        message_LayeredPane.setLayer(message_Label, javax.swing.JLayeredPane.DEFAULT_LAYER);
        message_LayeredPane.setLayer(message_ScrollPane, javax.swing.JLayeredPane.DEFAULT_LAYER);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.ipadx = 327;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(6, 10, 11, 10);
        jLayeredPane1.add(message_LayeredPane, gridBagConstraints);

        org.openide.awt.Mnemonics.setLocalizedText(save_Button, org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.save_Button.text")); // NOI18N
        save_Button.setToolTipText(org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.save_Button.toolTipText")); // NOI18N
        save_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                save_ButtonActionPerformed(evt);
            }
        });
        action_LayeredPane.add(save_Button);
        save_Button.setBounds(30, 0, 57, 23);

        org.openide.awt.Mnemonics.setLocalizedText(cancel_Button, org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.cancel_Button.text")); // NOI18N
        cancel_Button.setToolTipText(org.openide.util.NbBundle.getMessage(BeanValidationPanel.class, "BeanValidationPanel.cancel_Button.toolTipText")); // NOI18N
        cancel_Button.setPreferredSize(new java.awt.Dimension(60, 23));
        cancel_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancel_ButtonActionPerformed(evt);
            }
        });
        action_LayeredPane.add(cancel_Button);
        cancel_Button.setBounds(90, 0, 70, 23);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 450, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(action_LayeredPane, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(66, 66, 66))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addComponent(action_LayeredPane, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
  private boolean validateField() {
//        if (this.name_TextField.getText().trim().length() <= 0 /*|| Pattern.compile("[^\\w-]").matcher(this.id_TextField.getText().trim()).find()*/) {
//            JOptionPane.showMessageDialog(this, "Parameter column name can't be empty", "Invalid Value", javax.swing.JOptionPane.WARNING_MESSAGE);
//            return false;
//        }//I18n
//        if (this.referencedColumnName_TextField.getText().trim().length() <= 0 /*|| Pattern.compile("[^\\w-]").matcher(this.id_TextField.getText().trim()).find()*/) {
//            JOptionPane.showMessageDialog(this, "Parameter referenced column name can't be empty", "Invalid Value", javax.swing.JOptionPane.WARNING_MESSAGE);
//            return false;
//        }//I18n
        return true;
    }

    private void save_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_save_ButtonActionPerformed
        if (!validateField()) {
            return;
        }
        JoinColumn joinColumn = null;

        if (this.getEntity().getClass() == RowValue.class) {
            Object[] row = ((RowValue) this.getEntity()).getRow();
            if (row[0] == null) {
                joinColumn = new JoinColumn();
            } else {
                joinColumn = (JoinColumn) row[0];
            }
        }

//        joinColumn.setName(name_TextField.getText());
//        joinColumn.setReferencedColumnName(referencedColumnName_TextField.getText());
//        joinColumn.setTable(table_TextField.getText());
//        joinColumn.setColumnDefinition(columnDefinition_TextArea.getText());
//        joinColumn.setUnique(unique_CheckBox.isSelected());
//        joinColumn.setNullable(nullable_CheckBox.isSelected());
//        joinColumn.setInsertable(insertable_CheckBox.isSelected());
//        joinColumn.setUpdatable(updatable_CheckBox.isSelected());
        if (this.getEntity().getClass() == RowValue.class) {
            Object[] row = ((RowValue) this.getEntity()).getRow();
            row[0] = joinColumn;
            row[1] = joinColumn.getName();
            row[2] = joinColumn.getReferencedColumnName();
        }

        saveActionPerformed(evt);
    }//GEN-LAST:event_save_ButtonActionPerformed

    private void cancel_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancel_ButtonActionPerformed
        cancelActionPerformed(evt);
    }//GEN-LAST:event_cancel_ButtonActionPerformed

    private void validation_ComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_validation_ComboBoxActionPerformed
        String validationType = (String) ((Property) validation_ComboBox.getSelectedItem()).getKey();
        if (validationType.equals("ASSERT_TRUE") || validationType.equals("ASSERT_FALSE")
                || validationType.equals("NOT_NULL") || validationType.equals("NULL")
                || validationType.equals("PAST") || validationType.equals("FUTURE")) {
            max_LayeredPane.setVisible(false);
            min_LayeredPane.setVisible(false);
            integer_LayeredPane.setVisible(false);
            fraction_LayeredPane.setVisible(false);
            regex_LayeredPane.setVisible(false);
        } else if (validationType.equals("DECIMAL_MAX") || validationType.equals("MAX")) {
            max_LayeredPane.setVisible(true);
            min_LayeredPane.setVisible(false);
            integer_LayeredPane.setVisible(false);
            fraction_LayeredPane.setVisible(false);
            regex_LayeredPane.setVisible(false);
        } else if (validationType.equals("DECIMAL_MIN") || validationType.equals("MIN")) {
            max_LayeredPane.setVisible(false);
            min_LayeredPane.setVisible(true);
            integer_LayeredPane.setVisible(false);
            fraction_LayeredPane.setVisible(false);
            regex_LayeredPane.setVisible(false);
        } else if (validationType.equals("SIZE")) {
            max_LayeredPane.setVisible(true);
            min_LayeredPane.setVisible(true);
            integer_LayeredPane.setVisible(false);
            fraction_LayeredPane.setVisible(false);
            regex_LayeredPane.setVisible(false);
        } else if (validationType.equals("DIGITS")) {
            max_LayeredPane.setVisible(false);
            min_LayeredPane.setVisible(false);
            integer_LayeredPane.setVisible(true);
            fraction_LayeredPane.setVisible(true);
            regex_LayeredPane.setVisible(false);
        } else if (validationType.equals("PATTERN")) {
            max_LayeredPane.setVisible(false);
            min_LayeredPane.setVisible(false);
            integer_LayeredPane.setVisible(false);
            fraction_LayeredPane.setVisible(false);
            regex_LayeredPane.setVisible(true);
        }

    }//GEN-LAST:event_validation_ComboBoxActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLayeredPane action_LayeredPane;
    private javax.swing.JButton cancel_Button;
    private javax.swing.JLabel fraction_Label;
    private javax.swing.JLayeredPane fraction_LayeredPane;
    private javax.swing.JSpinner fraction_Spinner;
    private javax.swing.JLabel integer_Label;
    private javax.swing.JLayeredPane integer_LayeredPane;
    private javax.swing.JSpinner integer_Spinner;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JLabel max_Label;
    private javax.swing.JLayeredPane max_LayeredPane;
    private javax.swing.JSpinner max_Spinner;
    private javax.swing.JLabel message_Label;
    private javax.swing.JLayeredPane message_LayeredPane;
    private javax.swing.JScrollPane message_ScrollPane;
    private javax.swing.JLabel min_Label;
    private javax.swing.JLayeredPane min_LayeredPane;
    private javax.swing.JSpinner min_Spinner;
    private javax.swing.JLabel regex_Label;
    private javax.swing.JLayeredPane regex_LayeredPane;
    private javax.swing.JTextField regex_TextField;
    private javax.swing.JButton save_Button;
    private javax.swing.JComboBox validation_ComboBox;
    private javax.swing.JLabel validation_Label;
    private javax.swing.JLayeredPane validation_LayeredPane;
    // End of variables declaration//GEN-END:variables
}


text:
using System;

namespace PDFjet.NET {
/**
 *  Used to specify the text effects.
 *
 */
public class Effect {
    public const int NORMAL = 0;
    public const int SUBSCRIPT = 1;
    public const int SUPERSCRIPT = 2;
}
}   // End of namespace PDFjet.NET

redpajama_set_name: RedPajamaGithub


text:
package com.snowplowanalytics
package snowplow
package enrich
package stream

// Scala
import scala.util.{Try, Success, Failure}
import scala.collection.JavaConversions._
import scala.concurrent.duration.FiniteDuration
import scala.io.Source

// Scala libraries
import pureconfig._
import com.typesafe.config.ConfigFactory
import org.specs2.mutable.Specification
import org.specs2.matcher.{FutureMatchers, Matcher}

// Java
import java.util.regex.Pattern
import java.util.concurrent.TimeUnit

// Java libraries
import org.apache.commons.codec.binary.Base64
import com.hubspot.jinjava.Jinjava

// This project
import good._
import model.{StreamsConfig, SourceSinkConfig}

class PiiEmitSpec
  extends Specification with FutureMatchers with KafkaIntegrationSpec with BeforeAfterAll {

  var ktu: KafkaTestUtils = _
  override def beforeAll(): Unit = {
    ktu = new KafkaTestUtils
    ktu.setup()
    ktu.createTopics(kafkaTopics.toList: _*)
  }
  override def afterAll(): Unit = {
    if (ktu != null) {
      ktu = null
    }
  }

  import KafkaIntegrationSpecValues._

  def configValues = Map(
    "sinkType" -> "kafka",
    "streamsInRaw" -> s"$testGoodIn",
    "outEnriched" -> s"$testGood",
    "outPii" -> s"$testPii",
    "outBad" -> s"$testBad",
    "partitionKeyName" -> "\"\"",
    "kafkaBrokers" -> ktu.brokerAddress,
    "bufferTimeThreshold" -> "1",
    "bufferRecordThreshold" -> "1",
    "bufferByteThreshold" -> "100000",
    "enrichAppName" -> "Jim",
    "enrichStreamsOutMaxBackoff" -> "1000",
    "enrichStreamsOutMinBackoff" -> "1000",
    "appName" -> "jim"
  )

  def config: String = Try {
    val configRes = getClass.getResourceAsStream("/config.hocon.sample")
    Source.fromInputStream(configRes).getLines.mkString("\n")
  } match {
    case Failure(t) => {
      println(s"Unable to get config.hocon.sample: $t"); throw new Exception(t)
    }
    case Success(s) => s
  }

  def configInstance: String = {
    val jinJava = new Jinjava()
    jinJava.render(config, configValues)
  }

  private def decode(s: String): Array[Byte] = Base64.decodeBase64(s)

  // Input
  override val inputGood = List(
    decode(PagePingWithContextSpec.raw),
    decode(PageViewWithContextSpec.raw),
    decode(StructEventSpec.raw),
    decode(StructEventWithContextSpec.raw),
    decode(TransactionItemSpec.raw),
    decode(TransactionSpec.raw)
  )
  // Expected output counts
  override val (expectedGood, expectedBad, expectedPii) = (inputGood.size, 0, inputGood.size)

  // Timeout for the producer
  override val producerTimeoutSec = 5

  // Timeout for all the consumers (good, bad, and pii) (running in parallel)
  // You may want to adjust this if you are doing lots of slow work in the app
  // Ordinarily the consumers return in less than 1 sec
  override val consumerExecutionTimeoutSec = 15

  "Pii" should {
    "emit all events" in {
      implicit def hint[T]: ProductHint[T] =
        ProductHint[T](ConfigFieldMapping(CamelCase, CamelCase))
      implicit val sourceSinkConfigHint = new FieldCoproductHint[SourceSinkConfig]("enabled")

      val parsedConfig = ConfigFactory.parseString(configInstance).resolve()
      val configObject = Try {
        loadConfigOrThrow[StreamsConfig](parsedConfig.getConfig("enrich.streams"))
      }
      configObject aka "enrichment config loading" must not beAFailedTry
      val app = getMainApplicationFuture(
        configObject.get,
        SpecHelpers.resolver,
        SpecHelpers.adapterRegistry,
        SpecHelpers.enrichmentRegistry,
        None)
      inputProduced(ktu.brokerAddress) aka "sending input" must beSuccessfulTry

      def spaceJoinResult(expected: List[StringOrRegex]) =
        expected
          .flatMap({
            case JustRegex(r) => Some(r.toString)
            case JustString(s) if s.nonEmpty => Some(Pattern.quote(s))
            case _ => None
          })
          .mkString("\\s*")

      val expectedMatcher: Matcher[(List[String], List[String], List[String])] = beLike {
        case (good: List[String], bad: List[String], pii: List[String]) => {
          (bad aka "bad result list" must have size (expectedBad)) and
            (pii aka "pii result list" must have size (expectedPii)) and
            (good aka "good result list" must have size (expectedGood)) and
            (good aka "good result list" must containMatch(
              spaceJoinResult(PagePingWithContextSpec.expected))) and
            (pii aka "pii result list" must containMatch(spaceJoinResult(PagePingWithContextSpec.pii))) and
            (good aka "good result list" must containMatch(
              spaceJoinResult(PageViewWithContextSpec.expected))) and
            (pii aka "pii result list" must containMatch(spaceJoinResult(PageViewWithContextSpec.pii))) and
            (good aka "good result list" must containMatch(
              spaceJoinResult(StructEventSpec.expected))) and
            (pii aka "pii result list" must containMatch(spaceJoinResult(StructEventSpec.pii))) and
            (good aka "good result list" must containMatch(
              spaceJoinResult(StructEventWithContextSpec.expected))) and
            (pii aka "pii result list" must containMatch(spaceJoinResult(StructEventWithContextSpec.pii))) and
            (good aka "good result list" must containMatch(
              spaceJoinResult(TransactionItemSpec.expected))) and
            (pii aka "pii result list" must containMatch(spaceJoinResult(TransactionItemSpec.pii))) and
            (good aka "good result list" must containMatch(
              spaceJoinResult(TransactionSpec.expected))) and
            (pii aka "pii result list" must containMatch(spaceJoinResult(TransactionSpec.pii)))
        }
      }
      allResults(ktu.brokerAddress) must expectedMatcher.await(
        retries = 0,
        timeout = FiniteDuration(consumerExecutionTimeoutSec.toLong, TimeUnit.SECONDS))
    }
  }
}


text:
var shouldRemoveStyles = function(tab) {

  var urls = Settings.getUrls().split('\n');
  var isEnabled = false;

  for(var i=0; i < urls.length; i++) {
    var url = urls[i];
    regexp = new RegExp('^' + url.replace(/\*/g, '.*') + '$');
    if(tab.url.match(regexp)) {
      isEnabled = true;
    }
  }
  return isEnabled;
};

var getCSS = function() {
  var visitedColor = Settings.getColor();
  var css = 'a:visited { color: $VISITED !important;}';
  css = css.replace(/\$VISITED/, visitedColor);
  return css;
};

chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
  if(shouldRemoveStyles(tab)) {
    var css = getCSS();
    chrome.tabs.insertCSS(tabId, { code: css });
  }
});


text:
set -o errexit
set -o nounset
set -o pipefail

# Generates client.
# Required env vars:
#   CLEANUP_DIRS: List of directories (string separated by space) to cleanup before generation for this language
#   KUBERNETES_BRANCH: Kubernetes branch name to get the swagger spec from
#   CLIENT_VERSION: Client version. Will be used in the comment sections of the generated code
#   PACKAGE_NAME: Name of the client package.
#   SWAGGER_CODEGEN_COMMIT: swagger-codegen commit sha or tag/branch name. Will only be used as a reference in docs.
# Input vars:
#   $1: output directory
: "${CLEANUP_DIRS?Must set CLEANUP_DIRS env var}"
: "${KUBERNETES_BRANCH?Must set KUBERNETES_BRANCH env var}"
: "${CLIENT_VERSION?Must set CLIENT_VERSION env var}"
: "${CLIENT_LANGUAGE?Must set CLIENT_LANGUAGE env var}"
: "${PACKAGE_NAME?Must set PACKAGE_NAME env var}"
: "${SWAGGER_CODEGEN_COMMIT?Must set SWAGGER_CODEGEN_COMMIT env var}"

output_dir=$1
pushd "${output_dir}" > /dev/null
output_dir=`pwd`
popd > /dev/null
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")
pushd "${SCRIPT_ROOT}" > /dev/null
SCRIPT_ROOT=`pwd`
popd > /dev/null

if ! which mvn > /dev/null 2>&1; then
    echo "Maven is not installed."
    exit
fi

# There should be only one version of swagger-codegen-maven-plugin.
unset PLUGIN_VERSION
shopt -s nullglob
FOLDERS=(/root/.m2/repository/io/swagger/swagger-codegen-maven-plugin/*)
for folder in "${FOLDERS[@]}"; do
    if [[ -d "${folder}" ]]; then
        folder=$(basename "${folder}")
        if [[ ! -z "${PLUGIN_VERSION:-}" ]]; then
            echo "Multiple swagger-codegen-maven-plugin version exists: ${PLUGIN_VERSION} & ${folder}"
            exit 1
        fi
        PLUGIN_VERSION="${folder}"
    fi
done
if [[ -z "${PLUGIN_VERSION:-}" ]]; then
    echo "Cannot find swagger-codegen-maven-plugin version"
    exit 1
fi
shopt -u nullglob

# To make sure we can reproduce generation, we would also log code-gen exact commit
pushd /source/swagger-codegen
  SWAGGER_CODEGEN_COMMIT_ACTUAL=$(git rev-parse HEAD)
popd

mkdir -p "${output_dir}"

echo "--- Downloading and pre-processing OpenAPI spec"
python "${SCRIPT_ROOT}/preprocess_spec.py" "${CLIENT_LANGUAGE}" "${KUBERNETES_BRANCH}" "${output_dir}/swagger.json"

echo "--- Cleaning up previously generated folders"
for i in ${CLEANUP_DIRS}; do
    echo "--- Cleaning up ${output_dir}/${i}"
    rm -rf "${output_dir}/${i}"
done

echo "--- Generating client ..."
mvn -f "${SCRIPT_ROOT}/generation_params.xml" clean generate-sources -Dgenerator.spec.path="${output_dir}/swagger.json" -Dgenerator.output.path="${output_dir}" -D=generator.client.version="${CLIENT_VERSION}" -D=generator.package.name="${PACKAGE_NAME}" -D=swagger-codegen-version="${PLUGIN_VERSION}"

mkdir -p "${output_dir}/.swagger-codegen"
echo "Requested Commit: ${SWAGGER_CODEGEN_COMMIT}" > "${output_dir}/.swagger-codegen/COMMIT"
echo "Actual Commit: ${SWAGGER_CODEGEN_COMMIT_ACTUAL}" >> "${output_dir}/.swagger-codegen/COMMIT"

echo "---Done."
chown -R $(stat -c "%u:%g" ${output_dir}) ${output_dir}


text:
package com.createsend.util.exceptions;

/**
 * An exception raised when the API responds with a 404 Not Found
 */
public class NotFoundException extends CreateSendHttpException {
    private static final long serialVersionUID = -7730164870627844838L;

    public NotFoundException(int apiErrorCode, String apiErrorMessage) {
        super("The requested resource does not exist", 404, apiErrorCode, apiErrorMessage);
    }
}


text:
package com.intellij.ui;

import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonShortcuts;
import com.intellij.openapi.actionSystem.CustomShortcutSet;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.keymap.KeymapUtil;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.FixedSizeButton;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.util.NlsContexts;
import com.intellij.ui.components.fields.ExtendableTextComponent;
import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.JBUI;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import javax.swing.event.DocumentEvent;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.util.ArrayList;

public abstract class AbstractFieldPanel extends JPanel {
  private static final Logger LOG = Logger.getInstance(AbstractFieldPanel.class);
  private final JComponent myComponent;
  private Runnable myChangeListener;
  protected ArrayList<JButton> myButtons = new ArrayList<>(1);
  protected JLabel myLabel;
  private ActionListener myBrowseButtonActionListener;
  private final @NlsContexts.DialogTitle String myViewerDialogTitle;
  private @NlsContexts.Label String myLabelText;
  private TextFieldWithBrowseButton.MyDoClickAction myDoClickAction;

  public AbstractFieldPanel(JComponent component) {
    this(component, null, null, null, null);
  }

  public AbstractFieldPanel(JComponent component,
                            @NlsContexts.Label String labelText,
                            @NlsContexts.DialogTitle String viewerDialogTitle,
                            ActionListener browseButtonActionListener,
                            Runnable changeListener) {
    myComponent = component;
    setChangeListener(changeListener);
    setLabelText(labelText);
    setBrowseButtonActionListener(browseButtonActionListener);
    myViewerDialogTitle = viewerDialogTitle;
  }

  public abstract @Nls String getText();

  public abstract void setText(@Nls String text);

  @Override
  public void setEnabled(boolean enabled) {
    getComponent().setEnabled(enabled);
    if (myLabel != null) {
      myLabel.setEnabled(enabled);
    }
    for (JButton button: myButtons) {
      button.setEnabled(enabled);
    }
  }

  @Override
  public boolean isEnabled() {
    return myComponent != null && myComponent.isEnabled();
  }

  protected TextFieldWithBrowseButton.MyDoClickAction getDoClickAction() { return myDoClickAction; }

  public final JComponent getComponent() {
    return myComponent;
  }

  public final JLabel getFieldLabel() {
    if (myLabel == null){
      myLabel = new JLabel(myLabelText);
      add(myLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insetsBottom(5), 0, 0));
      myLabel.setLabelFor(getComponent());
    }
    return myLabel;
  }

  public final Runnable getChangeListener() {
    return myChangeListener;
  }

  public final void setChangeListener(Runnable runnable) {
    myChangeListener = runnable;
  }

  public void createComponent() {
    removeAll();
    setLayout(new GridBagLayout());

    if (myLabelText != null) {
      myLabel = new JLabel(myLabelText);
      this.add(myLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insetsBottom(5), 0, 0));
      myLabel.setLabelFor(myComponent);
    }

    this.add(myComponent, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                                                 JBInsets.emptyInsets(), 0, 0));

    if (myBrowseButtonActionListener != null) {
      if (myComponent instanceof ExtendableTextComponent) {
        ((ExtendableTextComponent)myComponent).addExtension(ExtendableTextComponent.Extension.create(
          getDefaultIcon(), getHoveredIcon(), getIconTooltip(), this::notifyActionListener));
        new DumbAwareAction() {
          @Override
          public void actionPerformed(@NotNull AnActionEvent e) {
            notifyActionListener();
          }
        }.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_DOWN_MASK)), myComponent);

      } else {
        FixedSizeButton browseButton = new FixedSizeButton(getComponent());
        myDoClickAction = new TextFieldWithBrowseButton.MyDoClickAction(browseButton);
        browseButton.setFocusable(false);
        browseButton.addActionListener(myBrowseButtonActionListener);
        myButtons.add(browseButton);
        this.add(browseButton, new GridBagConstraints(GridBagConstraints.RELATIVE, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insetsLeft(2), 0, 0));
      }
    }
    if (myViewerDialogTitle != null) {
      final FixedSizeButton showViewerButton = new FixedSizeButton(getComponent());
      if (myBrowseButtonActionListener == null) {
        LOG.assertTrue(myDoClickAction == null);
        myDoClickAction = new TextFieldWithBrowseButton.MyDoClickAction(showViewerButton);
      }
      showViewerButton.setFocusable(false);
      showViewerButton.setIcon(AllIcons.Actions.ShowViewer);
      showViewerButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
          Viewer viewer = new Viewer();
          viewer.setTitle(myViewerDialogTitle);
          viewer.show();
        }
      });
      myButtons.add(showViewerButton);
      this.add(showViewerButton, new GridBagConstraints(GridBagConstraints.RELATIVE, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
                                                        JBInsets.emptyInsets(), 0, 0));
    }
  }

  @NotNull
  protected Icon getDefaultIcon() {
    return AllIcons.General.OpenDisk;
  }

  @NotNull
  protected Icon getHoveredIcon() {
    return AllIcons.General.OpenDiskHover;
  }

  @NotNull
  protected @NlsContexts.Tooltip String getIconTooltip() {
    return UIBundle.message("component.with.browse.button.browse.button.tooltip.text") + " (" +
           KeymapUtil.getKeystrokeText(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_DOWN_MASK)) + ")";
  }

  private void notifyActionListener() {
    ActionEvent event = new ActionEvent(myComponent, ActionEvent.ACTION_PERFORMED, "action");
    if (myBrowseButtonActionListener != null) myBrowseButtonActionListener.actionPerformed(event);
  }

  public void setBrowseButtonActionListener(ActionListener browseButtonActionListener) {
    myBrowseButtonActionListener = browseButtonActionListener;
  }

  public void setLabelText(@NlsContexts.Label String labelText) {
    myLabelText = labelText;
  }

  public void setDisplayedMnemonic(char c) {
    getFieldLabel().setDisplayedMnemonic(c);
  }

  public void setDisplayedMnemonicIndex(int i) {
    getFieldLabel().setDisplayedMnemonicIndex(i);
  }

  protected class Viewer extends DialogWrapper {
    protected JTextArea myTextArea;

    public Viewer() {
      super(getComponent(), true);
      init();
    }

    @Override
    protected Action @NotNull [] createActions() {
      return new Action[]{getOKAction(), getCancelAction()};
    }

    @Override
    public JComponent getPreferredFocusedComponent() {
      return myTextArea;
    }

    @Override
    protected void doOKAction() {
      setText(myTextArea.getText());
      super.doOKAction();
    }

    @Override
    protected JComponent createCenterPanel() {
      myTextArea = new JTextArea(10, 50);
      myTextArea.setText(getText());
      myTextArea.setWrapStyleWord(true);
      myTextArea.setLineWrap(true);
      myTextArea.getDocument().addDocumentListener(new DocumentAdapter() {
        @Override
        public void textChanged(@NotNull DocumentEvent event) {
          if (myChangeListener != null) {
            myChangeListener.run();
          }
        }
      });

      DumbAwareAction.create(e -> doOKAction()).registerCustomShortcutSet(CommonShortcuts.ENTER, myTextArea);
      return ScrollPaneFactory.createScrollPane(myTextArea);
    }
  }
}


text:
layout: post
title: 'Unreal Tournament 2004 Demo'
date: 2004-02-14 09:43
comments: true
categories : []
---

is out for the Mac now. You can grab a copy of it here. After giving it a run or two on my 17" Powerbook all i can say is "Holy Crap". I had thought that it wouldn't play as well as Halo does but it's performance is noticeably better. Can't wait until they release and ship the full version.


text:
package com.google.common.css.compiler.ast;

import com.google.common.base.Preconditions;

import javax.annotation.Nullable;
import java.util.List;

/**
 * A node representing a CSS declaration in the abstract syntax tree.
 * For example: background: red
 *
 */
public class CssDeclarationNode extends CssNode {
  /** The node representing the property. */
  private CssPropertyNode propertyName;
  /** The value given to the property. */
  private CssPropertyValueNode propertyValue;
  /**
   * This will be set to true if this declaration node has a "star-hack"
   * (has a star before the property name).
   */
  private boolean hasStarHack;

  /**
   * Constructor of a node representing a CSS declaration.
   *
   * @param propertyName
   */
  public CssDeclarationNode(CssPropertyNode propertyName) {
    this(propertyName, new CssPropertyValueNode());
  }

  /**
   * Constructor of a node representing a CSS declaration.
   *
   * @param propertyName
   * @param comments
   */
  public CssDeclarationNode(CssPropertyNode propertyName,
                            List<CssCommentNode> comments) {
    this(propertyName, new CssPropertyValueNode(), comments);
  }

  /**
   * Constructor of a node representing a CSS declaration.
   *
   * @param propertyName
   * @param propertyValue
   */
  public CssDeclarationNode(CssPropertyNode propertyName,
                            CssPropertyValueNode propertyValue) {
    this(propertyName, propertyValue, null);
  }

  /**
   * Constructor of a node representing a CSS declaration.
   *
   * @param propertyName
   * @param propertyValue
   * @param comments
   */
  public CssDeclarationNode(CssPropertyNode propertyName,
                            CssPropertyValueNode propertyValue,
                            @Nullable List<CssCommentNode> comments) {
    this(propertyName, propertyValue, comments, false);
  }

  /**
   * Constructor of a node representing a CSS declaration.
   *
   * @param propertyName
   * @param propertyValue
   * @param comments
   * @param hasStarHack
   */
  public CssDeclarationNode(CssPropertyNode propertyName,
                            CssPropertyValueNode propertyValue,
                            @Nullable List<CssCommentNode> comments,
                            boolean hasStarHack) {
    super(null, comments, null);
    this.propertyName = propertyName;
    this.propertyValue = propertyValue;
    becomeParentForNode(this.propertyName);
    becomeParentForNode(this.propertyValue);
    this.setStarHack(hasStarHack);
  }

  /**
   * Copy constructor.
   *
   * @param node
   */
  public CssDeclarationNode(CssDeclarationNode node) {
    this(
        node.getPropertyName().deepCopy(),
        node.getPropertyValue().deepCopy(),
        node.getComments(),
        node.hasStarHack());

    this.setSourceCodeLocation(node.getSourceCodeLocation());
  }

  @Override
  public CssDeclarationNode deepCopy() {
    return new CssDeclarationNode(this);
  }

  public CssPropertyNode getPropertyName() {
    return propertyName;
  }

  public void setPropertyName(CssPropertyNode propertyName) {
    Preconditions.checkNotNull(propertyName);
    removeAsParentOfNode(this.propertyName);
    this.propertyName = propertyName;
    becomeParentForNode(this.propertyName);
  }

  public CssPropertyValueNode getPropertyValue() {
    return propertyValue;
  }

  public void setPropertyValue(CssPropertyValueNode propertyValue) {
    Preconditions.checkNotNull(propertyValue);
    removeAsParentOfNode(this.propertyValue);
    this.propertyValue = propertyValue;
    becomeParentForNode(this.propertyValue);
  }

  /**
   * Sets the hasStarHack attribute to the given value.
   *
   * @param hasStarHack
   */
  public void setStarHack(boolean hasStarHack) {
    this.hasStarHack = hasStarHack;
  }

  /**
   * Returns the value of this node's {@code hasStarHack} attribute.
   *
   * @return {@code true} if this node's {@code hasStarHack} is set to true.
   */
  public boolean hasStarHack() {
    return hasStarHack;
  }

  /**
   * For debugging only.
   */
  @Override
  public String toString() {
    String output = "";
    if (!getComments().isEmpty()) {
      output = getComments().toString();
    }
    if (hasStarHack()) {
      output = "*";
    }
    output += getPropertyName().getValue() + ":" + getPropertyValue();

    return output;
  }
}


text:
import Basic from "./Basic";
import WithStream from "./WithStream";
import WithTheme from "./WithTheme";

module.exports = {
	Basic: Basic,
	WithStream: WithStream,
	WithTheme: WithTheme
};


text:
using Funq;

namespace SupTree
{
    public interface ISupervisor
    {
        void Start();
        Container Container { get; }
    }
}


text:
require_relative "perf/execution"
require_relative "perf/iteration"
require_relative "perf/version"

module Benchmark
  module Perf
    # Measure iterations a work could take in a second
    #
    # @example
    #   Benchmark::Perf.ips { "foo" + "bar" }
    #
    # @param [Numeric] time
    #   the time to run measurements in seconds
    # @param [Numeric] warmup
    #   the warmup time in seconds
    #
    # @return [Array[Integer, Integer, Integer, Float]]
    #   the average, standard deviation, iterations and time
    #
    # @api public
    def ips(**options, &work)
      Iteration.run(**options, &work)
    end
    module_function :ips

    # Measure execution time(a.k.a cpu time) of a given work
    #
    # @example
    #   Benchmark::Perf.cpu { "foo" + "bar" }
    #
    # @param [Numeric] time
    #   the time to run measurements in seconds
    # @param [Numeric] warmup
    #   the warmup time in seconds
    # @param [Integer] repeat
    #   how many times to repeat measurements
    #
    # @return [Array[Float, Float]]
    #
    # @api public
    def cpu(**options, &work)
      Execution.run(**options, &work)
    end
    module_function :cpu
  end # Perf
end # Benchmark


text:
export const TOGGLE_ORG_MODAL = 'TOGGLE_ORG_MODAL';

export function toggleModal() {
  return {
    type: TOGGLE_ORG_MODAL
  };
}


text:
angular.module('app')
.config(function ($routeProvider) {

  $routeProvider.when('/admin/people/:id', { templateUrl: 'admin/people/show_info.html', controller: function ($scope, $route, $api, $window, $routeParams) {
    $scope.person_id = $routeParams.id;
    $scope.person = $api.get_person($routeParams.id);
    $scope.selected_tab = 'info';

    $scope.person.then(function(person) {
      $scope.person_update_form = {
        email: person.email,
        public_email: person.public_email,
        first_name: person.first_name,
        last_name: person.last_name,
        display_name: person.display_name,
        bio: person.bio,
        location: person.location,
        url: person.url,
        company: person.company
      };
      $scope.updatePerson = function() {
        $api.update_person(person.id, $scope.person_update_form).then(function(response) {
          $window.location.reload();
        });
      };
    });

    $api.get_teams({ person_id: $routeParams.id }).then(function(response) {
      $scope.teams = response.data;
    });

    $scope.deleteAccount = function(person) {
      var response = prompt("Type DELETE below if you really want to delete everything for: " + person.display_name);

      if (response === 'DELETE') {
        $scope.deleting_in_progress = true;
        $api.delete_person(person.id).then(function(response) {
          if (response.error) {
            $scope.error = response.data.error;
          } else {
            $api.get_person($routeParams.id).then(function(response) {
              $scope.person = response;
            });
          }
        });
      } else {
        alert("SYKE, just kidding, didn't do anything.");
      }
    };

  }});

  $routeProvider.when('/admin/people/:id/bounties', { templateUrl: 'admin/people/show_bounties.html', controller: function ($scope, $route, $api, $routeParams) {
    $scope.person_id = $routeParams.id;
    $scope.person = $api.get_person($routeParams.id);
    $scope.selected_tab = 'bounties';

    $api.get_bounties({ person_id: $routeParams.id }).then(function(results) {
      $scope.bounties = results.data;
    });
  }});

  $routeProvider.when('/admin/people/:id/events', { templateUrl: 'admin/people/show_events.html', controller: function ($scope, $route, $api, $routeParams) {
    $scope.person_id = $routeParams.id;
    $scope.person = $api.get_person($routeParams.id);
    $scope.selected_tab = 'events';

    $api.call('/admin/events', { person_id: $routeParams.id }, function(response) {
      $scope.events = response.data;
    });
  }});

  $routeProvider.when('/admin/people/:id/financial', { templateUrl: 'admin/people/show_financial.html', controller: function ($scope, $route, $api, $routeParams) {
    $scope.person_id = $routeParams.id;
    $scope.person = $api.get_person($routeParams.id);
    $scope.selected_tab = 'financial';

    $scope.giftMoney = function(giftValue, person) {
      if (giftValue > 0) {
        if (confirm("Are you sure you want to gift $" + giftValue + " to " + person.display_name + "?")) {
          $api.gift_money(person.id, giftValue).then(function(response) {
            if (response.created_at) {
              $scope.success_message = "Successfully gifted!";
            } else {
              $scope.error = response.data.error;
            }
          });
        }
      } else {
        $scope.error = "Gift must be greater than zero!";
      }
    };

  }});

  $routeProvider.when('/admin/people/:id/misc', { templateUrl: 'admin/people/show_misc.html', controller: function ($scope, $route, $api, $routeParams) {
    $scope.person_id = $routeParams.id;
    $scope.person = $api.get_person($routeParams.id);
    $scope.selected_tab = 'misc';

    $api.get_tags({ person_id: $routeParams.id }).then(function(response) {
      $scope.tag_votes = response.data;
    });

    $api.get_fundraisers({ person_id: $routeParams.id }).then(function(results) {
      $scope.fundraisers = results.data;
    });

  }});

  $routeProvider.when('/admin/people/:id/salt', { templateUrl: 'admin/people/show_salt.html', controller: function ($scope, $route, $api, $routeParams) {
    $scope.person_id = $routeParams.id;
    $scope.person = $api.get_person($routeParams.id);
    $scope.selected_tab = 'salt';
  }});

  $routeProvider.when('/admin/people/:id/team_payins', { templateUrl: 'admin/people/show_team_payins.html', controller: function ($scope, $route, $api, $routeParams) {
    $scope.person_id = $routeParams.id;
    $scope.person = $api.get_person($routeParams.id);
    $scope.selected_tab = 'team_payins';

    $scope.team_payins = $api.call("/admin/team_payins", { person_id: $routeParams.id });
  }});

});


text:
using System;
using System.IO;
using Machine.Specifications;

namespace Sourcery.Tests.UrlSource
{
    [Subject(typeof (Sources.UrlSource), "GetAsText")]
    public class When_I_get_a_file_as_text_from_a_url_twice
    {
        private static string _testFile;
        private static ISource _sut;
        private static string _text1;
        private static string _testContent;
        private static Uri _testUri;
        private static string _text2;

        private Establish context = () =>
        {
            _testFile = Path.GetTempFileName();
            _testUri = new Uri(_testFile);
            _testContent = "This is some example content";

            File.WriteAllText(_testFile, _testContent);

            _sut = Source.FromUri(_testUri);
        };

        private Because of = () =>
        {
            _text1 = _sut.GetAsText();
            _text2 = _sut.GetAsText();
        };

        private It should_return_all_lines_the_first_time = () => _text1.ShouldEqual(_testContent);

        private It should_return_all_lines_the_second_time = () => _text2.ShouldEqual(_testContent);

        private Cleanup stuff = () => File.Delete(_testFile);
    }
}


text:
@interface UIFont (Chango)

+ (instancetype)changoRegularFontOfSize:(CGFloat)size;

@end


text:
package zblibrary.demo.view;

import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;

import zblibrary.demo.activity.UserActivity;
import zblibrary.demo.model.User;

/**UserView的布局类,可直接写在layout文件内。
 * *不如直接使用BaseViewLayout方便
 * @author Lemon
 * @see UserActivity#initView()
 * @use uvl = (BaseViewLayout<Model>) findViewById(R.id.uvl);
 *      uvl.bindView(model);
 */
public class UserViewLayout extends BaseViewLayout<User> {

	public UserViewLayout(Context context) {
		super(context);
	}
	public UserViewLayout(Context context, AttributeSet attrs) {
		super(context, attrs);
	}
	public UserViewLayout(Context context, AttributeSet attrs, int defStyleAttr) {
		super(context, attrs, defStyleAttr);
	}

	@Override
	protected void init(Activity context) {
		super.init(context);
		createView(new UserView(context, null));
	}

}


text:
(function() {

    var width, height, largeHeader, canvas, ctx, points, target, animateHeader = true;

    // Main
    initHeader();
    addListeners();
    initAnimation();

    function initHeader() {
        largeHeader = document.getElementById('large-header-home');
        width = window.innerWidth;
        height = window.innerHeight;
        target = {x: width/2, y: height/2};

        canvas = document.getElementById('demo-canvas');
        canvas.width = width;
        canvas.height = height;
        ctx = canvas.getContext('2d');

        // create points
        points = [];
        for(var x = 0; x < width; x = x + width/20) {
            for(var y = 0; y < height; y = y + height/20) {
                var px = x + Math.random()*width/20;
                var py = y + Math.random()*height/20;
                var p = {x: px, originX: px, y: py, originY: py };
                points.push(p);
            }
        }

        // for each point find the 5 closest points
        for(var i = 0; i < points.length; i++) {
            var closest = [];
            var p1 = points[i];
            for(var j = 0; j < points.length; j++) {
                var p2 = points[j]
                if(!(p1 == p2)) {
                    var placed = false;
                    for(var k = 0; k < 5; k++) {
                        if(!placed) {
                            if(closest[k] == undefined) {
                                closest[k] = p2;
                                placed = true;
                            }
                        }
                    }

                    for(var k = 0; k < 5; k++) {
                        if(!placed) {
                            if(getDistance(p1, p2) < getDistance(p1, closest[k])) {
                                closest[k] = p2;
                                placed = true;
                            }
                        }
                    }
                }
            }
            p1.closest = closest;
        }

        // assign a circle to each point
        for(var i in points) {
            var c = new Circle(points[i], 2+Math.random()*2, 'rgba(255,255,255,0.3)');
            points[i].circle = c;
        }
    }

    // Event handling
    function addListeners() {
        if(!('ontouchstart' in window)) {
            window.addEventListener('mousemove', mouseMove);
        }

        // window.addEventListener('mousestill', mouseStill);

        window.addEventListener('scroll', scrollCheck);

        // Add for resizable window
        window.addEventListener('resize', resize);
    }

    function mouseMove(e) {
        var posx = posy = 0;
        if (e.pageX || e.pageY) {
            posx = e.pageX;
            posy = e.pageY;
        }
        else if (e.clientX || e.clientY)    {
            posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
            posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
        }
        target.x = posx;
        target.y = posy;
    }

    function scrollCheck() {
        if(document.body.scrollTop > height) animateHeader = false;
        else animateHeader = true;
    }

    //Resize
    function resize() {
        width = window.innerWidth;
        height = window.innerHeight;
        largeHeader.style.height = height+'px';
        canvas.width = width;
        canvas.height = height;
    }

    // animation
    function initAnimation() {
        animate();
        for(var i in points) {
            shiftPoint(points[i]);
        }
    }

    function animate() {
        if(animateHeader) {
            ctx.clearRect(0,0,width,height);
            for(var i in points) {
                // detect points in range
                if(Math.abs(getDistance(target, points[i])) < 4000) {
                    points[i].active = 0.3;
                    points[i].circle.active = 0.6;
                } else if(Math.abs(getDistance(target, points[i])) < 20000) {
                    points[i].active = 0.1;
                    points[i].circle.active = 0.3;
                } else if(Math.abs(getDistance(target, points[i])) < 40000) {
                    points[i].active = 0.02;
                    points[i].circle.active = 0.1;
                } else {
                    points[i].active = 0;
                    points[i].circle.active = 0;
                }

                drawLines(points[i]);
                points[i].circle.draw();
            }
        }
        requestAnimationFrame(animate);
    }

    function shiftPoint(p) {
        TweenLite.to(p, 1+1*Math.random(), {x:p.originX-50+Math.random()*100,
            y: p.originY-50+Math.random()*100, ease:Circ.easeInOut,
            onComplete: function() {
                shiftPoint(p);
            }});
    }

    // Canvas manipulation
    function drawLines(p) {
        if(!p.active) return;
        for(var i in p.closest) {
            ctx.beginPath();
            ctx.moveTo(p.x, p.y);
            ctx.lineTo(p.closest[i].x, p.closest[i].y);
            ctx.strokeStyle = 'rgba(156,217,249,'+ p.active+')';
            ctx.stroke();
        }
    }

    function Circle(pos,rad,color) {
        var _this = this;

        // constructor
        (function() {
            _this.pos = pos || null;
            _this.radius = rad || null;
            _this.color = color || null;
        })();

        this.draw = function() {
            if(!_this.active) return;
            ctx.beginPath();
            ctx.arc(_this.pos.x, _this.pos.y, _this.radius, 0, 2 * Math.PI, false);
            ctx.fillStyle = 'rgba(156,217,249,'+ _this.active+')';
            ctx.fill();
        };
    }

    // Util
    function getDistance(p1, p2) {
        return Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2);
    }

})();
////////////////////////////////////////////

// Smooth scrolling to top of page
$("a[href='#top']").click(function() {
  $("html, body").animate({ scrollTop: 0 }, "slow");
  return false;
});

//Nav bar
$(window).scroll(function () {
	if ($(window).scrollTop() >= 50) {
		$('.navbar').css('background','rgba(101,153,255,0.75)');
	}
	else {
		// $('.navbar').css('background','rgba(255,255,255,0.25)');
		$('.navbar').css('background','rgba(101,153,255,0.50)');
	}
});

// Start RYPP for youtube player
$(document).ready(function() {

  // Figure out why this isnt working
  // var api_key = process.env.YOUTUBE_KEY;
  var api_key = 'AIzaSyBYF2ckgQfblmixbe-5VGdh5UXjprm9OJg';

   // Initialize all the player in the page with default options
  $('.RYPP').rypp( api_key );
});

// Scroll to top button
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
    if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
        document.getElementById("myBtn").style.display = "block";
    } else {
        document.getElementById("myBtn").style.display = "none";
    }
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
    document.body.scrollTop = 0;
    document.documentElement.scrollTop = 0;
}

// Responsive Quote Carousel
// Run this function when DOM is ready
$(document).ready(function() {
  //Set the carousel options
  $('#quote-carousel').carousel({
    pauseOnHover: true,
    interval: 1000,
  });
});

// Cool pic grid
$(function() {
  $(".flex").flex();
});

// project photo gallery
$('ul.first').bsPhotoGallery({
  "classes" : "col-lg-2 col-md-4 col-sm-3 col-xs-4 col-xxs-12",
  "hasModal" : true
});

// Home photo galleries
$(document).ready(function(){

    $(".filter-button").click(function(){
        var value = $(this).attr('data-filter');

        if(value == "all")
        {
            //$('.filter').removeClass('hidden');
            $('.filter').show('1000');
        }
        else
        {
//            $('.filter[filter-item="'+value+'"]').removeClass('hidden');
//            $(".filter").not('.filter[filter-item="'+value+'"]').addClass('hidden');
            $(".filter").not('.'+value).hide('3000');
            $('.filter').filter('.'+value).show('3000');

        }
    });

    if ($(".filter-button").removeClass("active")) {
$(this).removeClass("active");
}
$(this).addClass("active");

});

function setSliderContainer() {
  var mq = checkMQ(); //function to check mq value
  if ( mq == 'desktop' ) {
    var slides = projectsSlider.children('li'), // projectsSlider = $('.cd-slider')
      slideWidth = slides.eq(0).width(),
      marginLeft = Number(projectsSlider.children('li').eq(1).css('margin-left').replace('px', '')),
      sliderWidth = ( slideWidth + marginLeft )*( slides.length ) + 'px',
      slideCurrentIndex = projectsSlider.children('li.current').index(); //index of the first visible slide

    projectsSlider.css('width', sliderWidth);
    //if the first visible slide is not the first <li> child, update the projectsSlider translate value
    ( slideCurrentIndex != 0 ) && setTranslateValue(projectsSlider, ( slideCurrentIndex * (slideWidth + marginLeft) + 'px'));
  } else {
    //on mobile, reset style
    projectsSlider.css('width', '');
    setTranslateValue(projectsSlider, 0);
  }
  resizing = false;
}
function setTranslateValue(item, translate) {
  item.css({
      '-moz-transform': 'translateX(-' + translate + ')',
      '-webkit-transform': 'translateX(-' + translate + ')',
    '-ms-transform': 'translateX(-' + translate + ')',
    '-o-transform': 'translateX(-' + translate + ')',
    'transform': 'translateX(-' + translate + ')',
  });
}

var resizing = false;
setSliderContainer();
$(window).on('resize', function(){
  //on resize - update projectsSlider width and translate value
  if( !resizing ) {
    window.requestAnimationFrame(setSliderContainer);
    resizing = true;
  }
});


text:
"""
Message encoding tests.

"""
from json import dumps, loads

from hamcrest import (
    assert_that,
    calling,
    equal_to,
    instance_of,
    is_,
    raises,
)
from marshmallow import ValidationError
from microcosm.api import create_object_graph

from microcosm_pubsub.tests.fixtures import DerivedSchema

def test_no_default_schema():
    """
    An unknown message type will fail.

    """
    graph = create_object_graph("example", testing=True)
    assert_that(
        calling(graph.pubsub_message_schema_registry.find).with_args("unknown"),
        raises(KeyError),
    )

def test_custom_schema():
    """
    A configured message type will use its schema.

    """
    graph = create_object_graph("example", testing=True)
    codec = graph.pubsub_message_schema_registry.find(DerivedSchema.MEDIA_TYPE)
    assert_that(codec.schema, is_(instance_of(DerivedSchema)))

def test_encode():
    """
    A message will be encoded according to its schema.

    """
    graph = create_object_graph("example", testing=True)
    codec = graph.pubsub_message_schema_registry.find(DerivedSchema.MEDIA_TYPE)
    assert_that(loads(codec.encode(data="data", media_type=DerivedSchema.MEDIA_TYPE)), is_(equal_to({
        "data": "data",
        "mediaType": DerivedSchema.MEDIA_TYPE,
    })))

def test_encode_missing_field():
    """
    An invalid message will raise errors.

    """
    graph = create_object_graph("example", testing=True)
    codec = graph.pubsub_message_schema_registry.find(DerivedSchema.MEDIA_TYPE)
    assert_that(calling(codec.encode), raises(ValidationError))

def test_decode():
    """
    A message will be decoded according to its schema.

    """
    graph = create_object_graph("example", testing=True)
    codec = graph.pubsub_message_schema_registry.find(DerivedSchema.MEDIA_TYPE)
    message = dumps({
        "data": "data",
        "mediaType": DerivedSchema.MEDIA_TYPE,
    })
    assert_that(codec.decode(message), is_(equal_to({
        "data": "data",
        "media_type": DerivedSchema.MEDIA_TYPE,
    })))

def test_decode_missing_media_type():
    """
    An invalid message will raise errors.

    """
    graph = create_object_graph("example", testing=True)
    codec = graph.pubsub_message_schema_registry.find(DerivedSchema.MEDIA_TYPE)
    message = dumps({
        "bar": "baz",
    })
    assert_that(calling(codec.decode).with_args(message), raises(ValidationError))

def test_decode_missing_field():
    """
    An invalid message will raise errors.

    """
    graph = create_object_graph("example", testing=True)
    codec = graph.pubsub_message_schema_registry.find(DerivedSchema.MEDIA_TYPE)
    message = dumps({
        "mediaType": DerivedSchema.MEDIA_TYPE,
    })
    assert_that(
        calling(codec.decode).with_args(message),
        raises(ValidationError, r".*DerivedSchema"),
    )


text:
<?php

namespace ShopwareAdapter\RequestGenerator\Product;

use SystemConnector\TransferObject\Product\Product;

interface ProductRequestGeneratorInterface
{
    /**
     * @param Product $product
     *
     * @return array
     */
    public function generate(Product $product): array;
}


text:
<?php

namespace Webiny\Component\Security\Token;

use Webiny\Component\Security\User\AbstractUser;

/**
 * Token storage interface.
 *
 * @package         Webiny\Component\Security\User\TokenStorage
 */
interface TokenStorageInterface
{

    /**
     * This function provides the token name to the storage.
     *
     * @param string $tokenName Token name.
     */
    public function setTokenName($tokenName);

    /**
     * This function provides the token 'remember me' flag to the storage.
     *
     * @param bool $rememberMe Token rememberme.
     */
    public function setTokenRememberMe($rememberMe);

    /**
     * Save user authentication token.
     *
     * @param AbstractUser $user Instance of AbstractUser class that holds the pre-filled object from user provider.
     *
     * @return bool
     */
    public function saveUserToken(AbstractUser $user);

    /**
     * Check if auth token is present, if true, try to load the right user and return it's username.
     *
     * @return bool|AbstractUser False it user token is not available, otherwise the AbstractUser object is returned.
     */
    public function loadUserFromToken();

    /**
     * Deletes the current auth token.
     *
     * @return bool
     */
    public function deleteUserToken();

    /**
     * Sets the security key that will be used for encryption of token data.
     *
     * @param string $securityKey Must have 16/32/64 chars.
     */
    public function setSecurityKey($securityKey);

    /**
     * Get token string representation
     * @return string
     */
    public function getTokenString();

    /**
     * Save the provided token string into the token storage.
     *
     * @param string $token Token string to save.
     */
    public function setTokenString($token);

    /**
     * Get token TTL in seconds
     *
     * @return int
     */
    public function getTokenTtl();
}


text:
(function( jQuery, window, undefined ) {
"use strict";

var warnedAbout = {};

// List of warnings already given; public read only
jQuery.migrateWarnings = [];

// Set to true to prevent console output; migrateWarnings still maintained
// jQuery.migrateMute = false;

// Forget any warnings we've already given; public
jQuery.migrateReset = function() {
	warnedAbout = {};
	jQuery.migrateWarnings.length = 0;
};

function migrateWarn( msg) {
	if ( !warnedAbout[ msg ] ) {
		warnedAbout[ msg ] = true;
		jQuery.migrateWarnings.push( msg );
		if ( window.console && console.warn && !jQuery.migrateMute ) {

		}
	}
}

function migrateWarnProp( obj, prop, value, msg ) {
	if ( Object.defineProperty ) {
		// On ES5 browsers (non-oldIE), warn if the code tries to get prop;
		// allow property to be overwritten in case some other plugin wants it
		try {
			Object.defineProperty( obj, prop, {
				configurable: true,
				enumerable: true,
				get: function() {
					migrateWarn( msg );
					return value;
				},
				set: function( newValue ) {
					migrateWarn( msg );
					value = newValue;
				}
			});
			return;
		} catch( err ) {
			// IE8 is a dope about Object.defineProperty, can't warn there
		}
	}

	// Non-ES5 (or broken) browser; just set the property
	jQuery._definePropertyBroken = true;
	obj[ prop ] = value;
}

if ( document.compatMode === "BackCompat" ) {
	// jQuery has never supported or tested Quirks Mode
	migrateWarn( "jQuery is not compatible with Quirks Mode" );
}

var attrFn = {},
	attr = jQuery.attr,
	valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
		function() { return null; },
	valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
		function() { return undefined; },
	rnoType = /^(?:input|button)$/i,
	rnoAttrNodeType = /^[238]$/,
	rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
	ruseDefault = /^(?:checked|selected)$/i;

// jQuery.attrFn
migrateWarnProp( jQuery, "attrFn", attrFn, "jQuery.attrFn is deprecated" );

jQuery.attr = function( elem, name, value, pass ) {
	var lowerName = name.toLowerCase(),
		nType = elem && elem.nodeType;

	if ( pass ) {
		migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
		if ( elem && !rnoAttrNodeType.test( nType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {
			return jQuery( elem )[ name ]( value );
		}
	}

	// Warn if user tries to set `type` since it breaks on IE 6/7/8
	if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) ) {
		migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
	}

	// Restore boolHook for boolean property/attribute synchronization
	if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {
		jQuery.attrHooks[ lowerName ] = {
			get: function( elem, name ) {
				// Align boolean attributes with corresponding properties
				// Fall back to attribute presence where some booleans are not supported
				var attrNode,
					property = jQuery.prop( elem, name );
				return property === true || typeof property !== "boolean" &&
					( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?

					name.toLowerCase() :
					undefined;
			},
			set: function( elem, value, name ) {
				var propName;
				if ( value === false ) {
					// Remove boolean attributes when set to false
					jQuery.removeAttr( elem, name );
				} else {
					// value is true since we know at this point it's type boolean and not false
					// Set boolean attributes to the same name and set the DOM property
					propName = jQuery.propFix[ name ] || name;
					if ( propName in elem ) {
						// Only set the IDL specifically if it already exists on the element
						elem[ propName ] = true;
					}

					elem.setAttribute( name, name.toLowerCase() );
				}
				return name;
			}
		};

		// Warn only for attributes that can remain distinct from their properties post-1.9
		if ( ruseDefault.test( lowerName ) ) {
			migrateWarn( "jQuery.fn.attr(" + lowerName + ") may use property instead of attribute" );
		}
	}

	return attr.call( jQuery, elem, name, value );
};

// attrHooks: value
jQuery.attrHooks.value = {
	get: function( elem, name ) {
		var nodeName = ( elem.nodeName || "" ).toLowerCase();
		if ( nodeName === "button" ) {
			return valueAttrGet.apply( this, arguments );
		}
		if ( nodeName !== "input" && nodeName !== "option" ) {
			migrateWarn("property-based jQuery.fn.attr('value') is deprecated");
		}
		return name in elem ?
			elem.value :
			null;
	},
	set: function( elem, value ) {
		var nodeName = ( elem.nodeName || "" ).toLowerCase();
		if ( nodeName === "button" ) {
			return valueAttrSet.apply( this, arguments );
		}
		if ( nodeName !== "input" && nodeName !== "option" ) {
			migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated");
		}
		// Does not return so that setAttribute is also used
		elem.value = value;
	}
};

var matched, browser,
	oldInit = jQuery.fn.init,
	// Note this does NOT include the # XSS fix from 1.7!
	rquickExpr = /^(?:.*(<[\w\W]+>)[^>]*|#([\w\-]*))$/;

// $(html) "looks like html" rule change
jQuery.fn.init = function( selector, context, rootjQuery ) {
	var match;

	if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
			(match = rquickExpr.exec( selector )) && match[1] ) {
		// This is an HTML string according to the "old" rules; is it still?
		if ( selector.charAt( 0 ) !== "<" ) {
			migrateWarn("$(html) HTML strings must start with '<' character");
		}
		// Now process using loose rules; let pre-1.8 play too
		if ( context && context.context ) {
			// jQuery object as context; parseHTML expects a DOM object
			context = context.context;
		}
		if ( jQuery.parseHTML ) {
			return oldInit.call( this, jQuery.parseHTML( jQuery.trim(selector), context, true ),
					context, rootjQuery );
		}
	}
	return oldInit.apply( this, arguments );
};
jQuery.fn.init.prototype = jQuery.fn;

jQuery.uaMatch = function( ua ) {
	ua = ua.toLowerCase();

	var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
		/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
		/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
		/(msie) ([\w.]+)/.exec( ua ) ||
		ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
		[];

	return {
		browser: match[ 1 ] || "",
		version: match[ 2 ] || "0"
	};
};

matched = jQuery.uaMatch( navigator.userAgent );
browser = {};

if ( matched.browser ) {
	browser[ matched.browser ] = true;
	browser.version = matched.version;
}

// Chrome is Webkit, but Webkit is also Safari.
if ( browser.chrome ) {
	browser.webkit = true;
} else if ( browser.webkit ) {
	browser.safari = true;
}

jQuery.browser = browser;

// Warn if the code tries to get jQuery.browser
migrateWarnProp( jQuery, "browser", browser, "jQuery.browser is deprecated" );

jQuery.sub = function() {
	function jQuerySub( selector, context ) {
		return new jQuerySub.fn.init( selector, context );
	}
	jQuery.extend( true, jQuerySub, this );
	jQuerySub.superclass = this;
	jQuerySub.fn = jQuerySub.prototype = this();
	jQuerySub.fn.constructor = jQuerySub;
	jQuerySub.sub = this.sub;
	jQuerySub.fn.init = function init( selector, context ) {
		if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
			context = jQuerySub( context );
		}

		return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
	};
	jQuerySub.fn.init.prototype = jQuerySub.fn;
	var rootjQuerySub = jQuerySub(document);
	migrateWarn( "jQuery.sub() is deprecated" );
	return jQuerySub;
};

var oldFnData = jQuery.fn.data;

jQuery.fn.data = function( name ) {
	var ret, evt,
		elem = this[0];

	// Handles 1.7 which has this behavior and 1.8 which doesn't
	if ( elem && name === "events" && arguments.length === 1 ) {
		ret = jQuery.data( elem, name );
		evt = jQuery._data( elem, name );
		if ( ( ret === undefined || ret === evt ) && evt !== undefined ) {
			migrateWarn("Use of jQuery.fn.data('events') is deprecated");
			return evt;
		}
	}
	return oldFnData.apply( this, arguments );
};

var rscriptType = /\/(java|ecma)script/i,
	oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack,
	oldFragment = jQuery.buildFragment;

jQuery.fn.andSelf = function() {
	migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
	return oldSelf.apply( this, arguments );
};

// Since jQuery.clean is used internally on older versions, we only shim if it's missing
if ( !jQuery.clean ) {
	jQuery.clean = function( elems, context, fragment, scripts ) {
		// Set context per 1.8 logic
		context = context || document;
		context = !context.nodeType && context[0] || context;
		context = context.ownerDocument || context;

		migrateWarn("jQuery.clean() is deprecated");

		var i, elem, handleScript, jsTags,
			ret = [];

		jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes );

		// Complex logic lifted directly from jQuery 1.8
		if ( fragment ) {
			// Special handling of each script element
			handleScript = function( elem ) {
				// Check if we consider it executable
				if ( !elem.type || rscriptType.test( elem.type ) ) {
					// Detach the script and store it in the scripts array (if provided) or the fragment
					// Return truthy to indicate that it has been handled
					return scripts ?
						scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
						fragment.appendChild( elem );
				}
			};

			for ( i = 0; (elem = ret[i]) != null; i++ ) {
				// Check if we're done after handling an executable script
				if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
					// Append to fragment and handle embedded scripts
					fragment.appendChild( elem );
					if ( typeof elem.getElementsByTagName !== "undefined" ) {
						// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
						jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );

						// Splice the scripts into ret after their former ancestor and advance our index beyond them
						ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
						i += jsTags.length;
					}
				}
			}
		}

		return ret;
	};
}

jQuery.buildFragment = function( elems, context, scripts, selection ) {
	var ret,
		warning = "jQuery.buildFragment() is deprecated";

	// Set context per 1.8 logic
	context = context || document;
	context = !context.nodeType && context[0] || context;
	context = context.ownerDocument || context;

	try {
		ret = oldFragment.call( jQuery, elems, context, scripts, selection );

	// jQuery < 1.8 required arrayish context; jQuery 1.9 fails on it
	} catch( x ) {
		ret = oldFragment.call( jQuery, elems, context.nodeType ? [ context ] : context[ 0 ], scripts, selection );

		// Success from tweaking context means buildFragment was called by the user
		migrateWarn( warning );
	}

	// jQuery < 1.9 returned an object instead of the fragment itself
	if ( !ret.fragment ) {
		migrateWarnProp( ret, "fragment", ret, warning );
		migrateWarnProp( ret, "cacheable", false, warning );
	}

	return ret;
};

var eventAdd = jQuery.event.add,
	eventRemove = jQuery.event.remove,
	eventTrigger = jQuery.event.trigger,
	oldToggle = jQuery.fn.toggle,
	oldLive = jQuery.fn.live,
	oldDie = jQuery.fn.die,
	ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
	rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
	rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
	hoverHack = function( events ) {
		if ( typeof( events ) != "string" || jQuery.event.special.hover ) {
			return events;
		}
		if ( rhoverHack.test( events ) ) {
			migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'");
		}
		return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
	};

// Event props removed in 1.9, put them back if needed; no practical way to warn them
if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {
	jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" );
}

// Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );

// Support for 'hover' pseudo-event and ajax event warnings
jQuery.event.add = function( elem, types, handler, data, selector ){
	if ( elem !== document && rajaxEvent.test( types ) ) {
		migrateWarn( "AJAX events should be attached to document: " + types );
	}
	eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector );
};
jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){
	eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
};

jQuery.fn.error = function() {
	var args = Array.prototype.slice.call( arguments, 0);
	migrateWarn("jQuery.fn.error() is deprecated");
	args.splice( 0, 0, "error" );
	if ( arguments.length ) {
		return this.bind.apply( this, args );
	}
	// error event should not bubble to window, although it does pre-1.7
	this.triggerHandler.apply( this, args );
	return this;
};

jQuery.fn.toggle = function( fn, fn2 ) {

	// Don't mess with animation or css toggles
	if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
		return oldToggle.apply( this, arguments );
	}
	migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");

	// Save reference to arguments for access in closure
	var args = arguments,
		guid = fn.guid || jQuery.guid++,
		i = 0,
		toggler = function( event ) {
			// Figure out which function to execute
			var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
			jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );

			// Make sure that clicks stop
			event.preventDefault();

			// and execute the function
			return args[ lastToggle ].apply( this, arguments ) || false;
		};

	// link all the functions, so any of them can unbind this click handler
	toggler.guid = guid;
	while ( i < args.length ) {
		args[ i++ ].guid = guid;
	}

	return this.click( toggler );
};

jQuery.fn.live = function( types, data, fn ) {
	migrateWarn("jQuery.fn.live() is deprecated");
	if ( oldLive ) {
		return oldLive.apply( this, arguments );
	}
	jQuery( this.context ).on( types, this.selector, data, fn );
	return this;
};

jQuery.fn.die = function( types, fn ) {
	migrateWarn("jQuery.fn.die() is deprecated");
	if ( oldDie ) {
		return oldDie.apply( this, arguments );
	}
	jQuery( this.context ).off( types, this.selector || "**", fn );
	return this;
};

// Turn global events into document-triggered events
jQuery.event.trigger = function( event, data, elem, onlyHandlers  ){
	if ( !elem & !rajaxEvent.test( event ) ) {
		migrateWarn( "Global events are undocumented and deprecated" );
	}
	return eventTrigger.call( this,  event, data, elem || document, onlyHandlers  );
};
jQuery.each( ajaxEvents.split("|"),
	function( _, name ) {
		jQuery.event.special[ name ] = {
			setup: function() {
				var elem = this;

				// The document needs no shimming; must be !== for oldIE
				if ( elem !== document ) {
					jQuery.event.add( document, name + "." + jQuery.guid, function() {
						jQuery.event.trigger( name, null, elem, true );
					});
					jQuery._data( this, name, jQuery.guid++ );
				}
				return false;
			},
			teardown: function() {
				if ( this !== document ) {
					jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
				}
				return false;
			}
		};
	}
);

})( jQuery, window );


text:
namespace app {

    using namespace pgc1000;

    class DemoImage : public App {
    public:
        typedef App super;

        virtual void init();

        virtual void update();

    protected:
        s8 mToneNum;
        bool mShowInfo;
    };

}


text:
<?php namespace Temoa\Command\DependencyAdmin;

use Temoa\Command\ListCommandTrait;

class ListCommand {

    use ListCommandTrait;

}


text:
<?php

namespace OpenOrchestra\ModelBundle\DataFixtures\MongoDB;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use OpenOrchestra\ModelBundle\Document\Redirection;
use OpenOrchestra\ModelInterface\DataFixtures\OrchestraFunctionalFixturesInterface;

/**
 * Class LoadRedirectionData
 */
class LoadRedirectionData implements FixtureInterface, OrchestraFunctionalFixturesInterface
{
    /**
     * @param ObjectManager $manager
     */
    function load(ObjectManager $manager)
    {
        $manager->persist($this->generateGoogleRedirection());
        $manager->persist($this->generateNodeRedirection());

        $manager->flush();
    }

    /**
     * @return Redirection
     */
    protected function generateGoogleRedirection()
    {
        $redirection = new Redirection();
        $redirection->setSiteId('2');
        $redirection->setSiteName('Demo site');
        $redirection->setRoutePattern('/google');
        $redirection->setLocale('fr');
        $redirection->setUrl('http://google.fr');
        $redirection->setPermanent(true);

        return $redirection;
    }

    /**
     * @return Redirection
     */
    protected function generateNodeRedirection()
    {
        $redirection = new Redirection();
        $redirection->setSiteId('2');
        $redirection->setSiteName('Demo site');
        $redirection->setRoutePattern('/test-root-redirection');
        $redirection->setLocale('fr');
        $redirection->setPermanent(false);
        $redirection->setNodeId('root');

        return $redirection;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
using Microsoft.Azure.Management.Automation.Models;

namespace Microsoft.Azure.Management.Automation.Models
{
    /// <summary>
    /// The parameters supplied to the create job operation.
    /// </summary>
    public partial class JobCreateProperties
    {
        private string _name;

        /// <summary>
        /// Optional. Gets or sets the name.
        /// </summary>
        public string Name
        {
            get { return this._name; }
            set { this._name = value; }
        }

        private IDictionary<string, string> _parameters;

        /// <summary>
        /// Optional. Gets or sets the parameters of the job.
        /// </summary>
        public IDictionary<string, string> Parameters
        {
            get { return this._parameters; }
            set { this._parameters = value; }
        }

        private RunbookAssociationProperty _runbook;

        /// <summary>
        /// Required. Gets or sets the runbook.
        /// </summary>
        public RunbookAssociationProperty Runbook
        {
            get { return this._runbook; }
            set { this._runbook = value; }
        }

        private string _runOn;

        /// <summary>
        /// Optional. Gets or sets the runOn which specifies the group name
        /// where the job is to be executed.
        /// </summary>
        public string RunOn
        {
            get { return this._runOn; }
            set { this._runOn = value; }
        }

        /// <summary>
        /// Initializes a new instance of the JobCreateProperties class.
        /// </summary>
        public JobCreateProperties()
        {
            this.Parameters = new LazyDictionary<string, string>();
        }

        /// <summary>
        /// Initializes a new instance of the JobCreateProperties class with
        /// required arguments.
        /// </summary>
        public JobCreateProperties(RunbookAssociationProperty runbook)
            : this()
        {
            if (runbook == null)
            {
                throw new ArgumentNullException("runbook");
            }
            this.Runbook = runbook;
        }
    }
}