(Editor editor)
| 66 | |
| 67 | |
| 68 | public FindReplace(Editor editor) { |
| 69 | super(Language.text("find")); |
| 70 | this.editor = editor; |
| 71 | |
| 72 | Container pain = getContentPane(); |
| 73 | |
| 74 | JLabel findLabel = new JLabel(Language.text("find.find")); |
| 75 | JLabel replaceLabel = new JLabel(Language.text("find.replace_with")); |
| 76 | findField = new JTextField(); |
| 77 | replaceField = new JTextField(); |
| 78 | |
| 79 | if (findString != null) findField.setText(findString); |
| 80 | if (replaceString != null) replaceField.setText(replaceString); |
| 81 | |
| 82 | ignoreCaseBox = new JCheckBox(Language.text("find.ignore_case")); |
| 83 | ignoreCaseBox.addActionListener(new ActionListener() { |
| 84 | public void actionPerformed(ActionEvent e) { |
| 85 | ignoreCase = ignoreCaseBox.isSelected(); |
| 86 | } |
| 87 | }); |
| 88 | ignoreCaseBox.setSelected(ignoreCase); |
| 89 | |
| 90 | allTabsBox = new JCheckBox(Language.text("find.all_tabs")); |
| 91 | allTabsBox.addActionListener(new ActionListener() { |
| 92 | public void actionPerformed(ActionEvent e) { |
| 93 | allTabs = allTabsBox.isSelected(); |
| 94 | } |
| 95 | }); |
| 96 | allTabsBox.setSelected(allTabs); |
| 97 | allTabsBox.setEnabled(true); |
| 98 | |
| 99 | wrapAroundBox = new JCheckBox(Language.text("find.wrap_around")); |
| 100 | wrapAroundBox.addActionListener(new ActionListener() { |
| 101 | public void actionPerformed(ActionEvent e) { |
| 102 | wrapAround = wrapAroundBox.isSelected(); |
| 103 | } |
| 104 | }); |
| 105 | wrapAroundBox.setSelected(wrapAround); |
| 106 | |
| 107 | GroupLayout layout = new GroupLayout(pain); |
| 108 | pain.setLayout(layout); |
| 109 | layout.setAutoCreateGaps(true); |
| 110 | layout.setAutoCreateContainerGaps(true); |
| 111 | |
| 112 | // To hold the buttons in the specified order depending on the OS |
| 113 | Group buttonsHorizontalGroup = layout.createSequentialGroup(); |
| 114 | |
| 115 | replaceAllButton = new JButton(Language.text("find.btn.replace_all")); |
| 116 | replaceButton = new JButton(Language.text("find.btn.replace")); |
| 117 | replaceAndFindButton = new JButton(Language.text("find.btn.replace_and_find")); |
| 118 | previousButton = new JButton(Language.text("find.btn.previous")); |
| 119 | findButton = new JButton(Language.text("find.btn.find")); |
| 120 | |
| 121 | // ordering is different on mac versus pc |
| 122 | if (Platform.isMacOS()) { |
| 123 | buttonsHorizontalGroup.addComponent(replaceAllButton) |
| 124 | .addComponent(replaceButton) |
| 125 | .addComponent(replaceAndFindButton) |
nothing calls this directly
no test coverage detected