File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/dialog/RecurrenceDialog.java | File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/folder/FolderOptionsDialog.java | |||
Method name: JPanel createButtonPanel()
|
Method name: JPanel createButtonPanel()
|
|||
Number of AST nodes: 21 | Number of AST nodes: 21 | |||
1 | JPanel bottom = new JPanel(); ↵ | 1 | JPanel bottom = new JPanel();↵ | |
2 | bottom.setLayout(new BorderLayout()); ↵ | 2 | bottom.setLayout(new BorderLayout());↵ | |
3 | bottom.setBorder(new SingleSideEtchedBorder(SwingConstants.TOP));↵ | 3 | // bottom.setBorder(new SingleSideEtchedBorder(SwingConstants.TOP));↵ | |
4 | ↵ | |||
4 | // bottom.setLayout( new BoxLayout( bottom, BoxLayout.X_AXIS ) );↵ | |||
5 | // bottom.add( Box.createHorizontalStrut());↵ | |||
5 | ButtonWithMnemonic cancelButton = new ButtonWithMnemonic( ↵ | 6 | ButtonWithMnemonic cancelButton = new ButtonWithMnemonic(↵ | |
6 | MailResourceLoader.getString("global", "cancel"));↵ | 7 | MailResourceLoader.getString("global", "cancel"));↵ | |
7 | ↵ | 8 | //$NON-NLS-1$ //$NON-NLS-2$↵ | |
8 | //$NON-NLS-1$ //$NON-NLS-2$ ↵ | 9 | //$NON-NLS-1$ //$NON-NLS-2$↵ | |
9 | cancelButton.addActionListener(this); ↵ | 10 | cancelButton.addActionListener(this);↵ | |
10 | cancelButton.setActionCommand("CANCEL"); //$NON-NLS-1$↵ | 11 | cancelButton.setActionCommand("CANCEL"); //$NON-NLS-1$↵ | |
11 | ↵ | |||
12 | ButtonWithMnemonic okButton = new ButtonWithMnemonic(MailResourceLoader ↵ | 12 | ButtonWithMnemonic okButton = new ButtonWithMnemonic(MailResourceLoader↵ | |
13 | .getString("global", "ok"));↵ | 13 | .getString("global", "ok"));↵ | |
14 | ↵ | 14 | //$NON-NLS-1$ //$NON-NLS-2$↵ | |
15 | //$NON-NLS-1$ //$NON-NLS-2$ ↵ | 15 | //$NON-NLS-1$ //$NON-NLS-2$↵ | |
16 | okButton.addActionListener(this); ↵ | 16 | okButton.addActionListener(this);↵ | |
17 | okButton.setActionCommand("OK"); //$NON-NLS-1$ ↵ | 17 | okButton.setActionCommand("OK"); //$NON-NLS-1$↵ | |
18 | okButton.setDefaultCapable(true); ↵ | 18 | okButton.setDefaultCapable(true);↵ | |
19 | getRootPane().setDefaultButton(okButton);↵ | 19 | getRootPane().setDefaultButton(okButton);↵ | |
20 | ↵ | |||
21 | ButtonWithMnemonic helpButton = new ButtonWithMnemonic( ↵ | 20 | ButtonWithMnemonic helpButton = new ButtonWithMnemonic(↵ | |
22 | MailResourceLoader.getString("global", "help"));↵ | 21 | MailResourceLoader.getString("global", "help"));↵ | |
23 | ↵ | 22 | //$NON-NLS-1$ //$NON-NLS-2$↵ | |
24 | // associate with JavaHelp ↵ | 23 | // associate with JavaHelp↵ | |
25 | HelpManager.getInstance().enableHelpOnButton(helpButton, ↵ | 24 | HelpManager.getInstance().enableHelpOnButton(helpButton,↵ | |
26 | "configuring_columba");↵ | 25 | "↵ | |
27 | ↵ | 26 | folder_options");↵ | |
27 | HelpManager.getInstance()↵ | |||
28 | .enableHelpKey(getRootPane(), "folder_options");↵ | |||
28 | JPanel buttonPanel = new JPanel(); ↵ | 29 | JPanel buttonPanel = new JPanel();↵ | |
29 | buttonPanel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); ↵ | 30 | buttonPanel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));↵ | |
30 | buttonPanel.setLayout(new GridLayout(1, 3, 6, 0)); ↵ | 31 | buttonPanel.setLayout(new GridLayout(1, 3, 6, 0));↵ | |
31 | buttonPanel.add(okButton); ↵ | 32 | buttonPanel.add(okButton);↵ | |
32 | buttonPanel.add(cancelButton); ↵ | 33 | buttonPanel.add(cancelButton);↵ | |
33 | buttonPanel.add(helpButton);↵ | 34 | buttonPanel.add(helpButton);↵ | |
34 | ↵ | |||
35 | // bottom.add( Box.createHorizontalGlue() );↵ | |||
35 | bottom.add(buttonPanel, BorderLayout.EAST);↵ | 36 | bottom.add(buttonPanel, BorderLayout.EAST);↵ | |
36 | ↵ | |||
37 | return bottom; | 37 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 193 |
Number of mapped statements | 20 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | JPanel bottom = new JPanel(); | 1 | JPanel bottom = new JPanel(); | |||||||||||
2 | bottom.setLayout(new BorderLayout()); | 2 | bottom.setLayout(new BorderLayout()); | |||||||||||
3 | bottom.setBorder(new SingleSideEtchedBorder(SwingConstants.TOP)); |
| | |||||||||||
4 | ButtonWithMnemonic cancelButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "cancel")); | 3 | ButtonWithMnemonic cancelButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "cancel")); | |||||||||||
5 | cancelButton.addActionListener(this); | 4 | cancelButton.addActionListener(this); | |||||||||||
6 | cancelButton.setActionCommand("CANCEL"); | 5 | cancelButton.setActionCommand("CANCEL"); | |||||||||||
7 | ButtonWithMnemonic okButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "ok")); | 6 | ButtonWithMnemonic okButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "ok")); | |||||||||||
8 | okButton.addActionListener(this); | 7 | okButton.addActionListener(this); | |||||||||||
9 | okButton.setActionCommand("OK"); | 8 | okButton.setActionCommand("OK"); | |||||||||||
10 | okButton.setDefaultCapable(true); | 9 | okButton.setDefaultCapable(true); | |||||||||||
11 | getRootPane().setDefaultButton(okButton); | 10 | getRootPane().setDefaultButton(okButton); | |||||||||||
12 | ButtonWithMnemonic helpButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "help")); | 11 | ButtonWithMnemonic helpButton = new ButtonWithMnemonic(MailResourceLoader.getString("global", "help")); | |||||||||||
13 | HelpManager.getInstance().enableHelpOnButton(helpButton, "configuring_columba"); |
| 12 | HelpManager.getInstance().enableHelpOnButton(helpButton, "folder_options"); | ||||||||||
| 13 | HelpManager.getInstance().enableHelpKey(getRootPane(), "folder_options"); | ||||||||||||
14 | JPanel buttonPanel = new JPanel(); | 14 | JPanel buttonPanel = new JPanel(); | |||||||||||
15 | buttonPanel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); | 15 | buttonPanel.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); | |||||||||||
16 | buttonPanel.setLayout(new GridLayout(1, 3, 6, 0)); | 16 | buttonPanel.setLayout(new GridLayout(1, 3, 6, 0)); | |||||||||||
17 | buttonPanel.add(okButton); | 17 | buttonPanel.add(okButton); | |||||||||||
18 | buttonPanel.add(cancelButton); | 18 | buttonPanel.add(cancelButton); | |||||||||||
19 | buttonPanel.add(helpButton); | 19 | buttonPanel.add(helpButton); | |||||||||||
20 | bottom.add(buttonPanel, BorderLayout.EAST); | 20 | bottom.add(buttonPanel, BorderLayout.EAST); | |||||||||||
21 | return bottom; | 21 | return bottom; |
Row | Violation |
---|---|
1 | Unmatched statement bottom.setBorder(new SingleSideEtchedBorder(SwingConstants.TOP)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Clone fragment #1 returns variables bottom , while Clone fragment #2 returns variables |