private void addDeleteRefActionCheckBox(JPanel panel, int col, int row) { GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.anchor = GridBagConstraints.WEST; //i18n[SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel=Add delete //referential action to the FK definition] String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel"); // i18n[SQLScriptPreferencesPanel.deleteRefActionToolTip=Append ON DELETE ...] String cbToolTipText = s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionToolTip"); deleteReferentialActionCheckbox = new JCheckBox(cbLabelStr); deleteReferentialActionCheckbox.setToolTipText(cbToolTipText); deleteReferentialActionCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean enabled = deleteReferentialActionCheckbox.isSelected(); deleteActionLabel.setEnabled(enabled); deleteActionComboBox.setEnabled(enabled); } }); panel.add(deleteReferentialActionCheckbox, c);
private void addUpdateRefActionCheckBox(JPanel panel, int col, int row) { GridBagConstraints c = new GridBagConstraints(); c.gridx = col; c.gridy = row; c.anchor = GridBagConstraints.WEST; //i18n[SQLScriptPreferencesPanel.updateRefActionCheckboxLabel=Add update //referential action to the FK definition] String cbLabelStr = s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionCheckboxLabel"); // i18n[SQLScriptPreferencesPanel.updateRefActionToolTip=Append ON UPDATE ...] String cbToolTipText = s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionToolTip"); updateReferentialActionCheckbox = new JCheckBox(cbLabelStr); updateReferentialActionCheckbox.setToolTipText(cbToolTipText); updateReferentialActionCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean enabled = updateReferentialActionCheckbox.isSelected(); updateActionLabel.setEnabled(enabled); updateActionComboBox.setEnabled(enabled); } }); panel.add(updateReferentialActionCheckbox, c);
Clone fragments detected by clone detection tool
File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferencesPanel.java File path: /sql12/plugins/sqlscript/src/net/sourceforge/squirrel_sql/plugins/sqlscript/prefs/SQLScriptPreferencesPanel.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
private void addDeleteRefActionCheckBox(JPanel panel, int col, int row) {
1
private void addUpdateRefActionCheckBox(JPanel panel, int col, int row) {
2
        GridBagConstraints c = new GridBagConstraints();
2
        GridBagConstraints c = new GridBagConstraints();
3
        c.gridx = col;
3
        c.gridx = col;
4
        c.gridy = row;  
4
        c.gridy = row;  
5
        c.anchor = GridBagConstraints.WEST;
5
        c.anchor = GridBagConstraints.WEST;
6
        //i18n[SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel=Add delete 
6
        //i18n[SQLScriptPreferencesPanel.updateRefActionCheckboxLabel=Add update 
7
        //referential action to the FK definition]
7
        //referential action to the FK definition]
8
        String cbLabelStr = 
8
        String cbLabelStr = 
9
            s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionCheckboxLabel");
9
            s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionCheckboxLabel");
10
        // i18n[SQLScriptPreferencesPanel.deleteRefActionToolTip=Append ON DELETE ...]
10
        // i18n[SQLScriptPreferencesPanel.updateRefActionToolTip=Append ON UPDATE ...]
11
        String cbToolTipText = 
11
        String cbToolTipText = 
12
            s_stringMgr.getString("SQLScriptPreferencesPanel.deleteRefActionToolTip");
12
            s_stringMgr.getString("SQLScriptPreferencesPanel.updateRefActionToolTip");
13
        deleteReferentialActionCheckbox = new JCheckBox(cbLabelStr);
13
        updateReferentialActionCheckbox = new JCheckBox(cbLabelStr);
14
        deleteReferentialActionCheckbox.setToolTipText(cbToolTipText);
14
        updateReferentialActionCheckbox.setToolTipText(cbToolTipText);
15
        deleteReferentialActionCheckbox.addActionListener(new ActionListener() {
15
        updateReferentialActionCheckbox.addActionListener(new ActionListener() {
16
            public void actionPerformed(ActionEvent e) {
16
            public void actionPerformed(ActionEvent e) {
17
                boolean enabled = deleteReferentialActionCheckbox.isSelected();
17
                boolean enabled = updateReferentialActionCheckbox.isSelected();
18
                deleteActionLabel.setEnabled(enabled);
18
                updateActionLabel.setEnabled(enabled);
19
                deleteActionComboBox.setEnabled(enabled);
19
                updateActionComboBox.setEnabled(enabled);
20
            }
20
            }
21
        });
21
        });
22
        panel.add(deleteReferentialActionCheckbox, c);
22
        panel.add(updateReferentialActionCheckbox, c);
23
    
23
    
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0