(final SketchTextArea textarea)
| 192 | } |
| 193 | |
| 194 | private void configurePopupMenu(final SketchTextArea textarea){ |
| 195 | |
| 196 | JPopupMenu menu = textarea.getPopupMenu(); |
| 197 | |
| 198 | menu.addSeparator(); |
| 199 | |
| 200 | JMenuItem item = editor.createToolMenuItem("cc.arduino.packages.formatter.AStyle"); |
| 201 | if (item == null) { |
| 202 | throw new NullPointerException("Tool cc.arduino.packages.formatter.AStyle unavailable"); |
| 203 | } |
| 204 | item.setName("menuToolsAutoFormat"); |
| 205 | |
| 206 | menu.add(item); |
| 207 | |
| 208 | item = new JMenuItem(tr("Comment/Uncomment"), '/'); |
| 209 | item.addActionListener(new ActionListener() { |
| 210 | public void actionPerformed(ActionEvent e) { |
| 211 | handleCommentUncomment(); |
| 212 | } |
| 213 | }); |
| 214 | menu.add(item); |
| 215 | |
| 216 | item = new JMenuItem(tr("Increase Indent"), ']'); |
| 217 | item.addActionListener(new ActionListener() { |
| 218 | public void actionPerformed(ActionEvent e) { |
| 219 | handleIndentOutdent(true); |
| 220 | } |
| 221 | }); |
| 222 | menu.add(item); |
| 223 | |
| 224 | item = new JMenuItem(tr("Decrease Indent"), '['); |
| 225 | item.setName("menuDecreaseIndent"); |
| 226 | item.addActionListener(new ActionListener() { |
| 227 | public void actionPerformed(ActionEvent e) { |
| 228 | handleIndentOutdent(false); |
| 229 | } |
| 230 | }); |
| 231 | menu.add(item); |
| 232 | |
| 233 | item = new JMenuItem(tr("Copy for Forum")); |
| 234 | item.addActionListener(new ActionListener() { |
| 235 | public void actionPerformed(ActionEvent e) { |
| 236 | handleDiscourseCopy(); |
| 237 | } |
| 238 | }); |
| 239 | menu.add(item); |
| 240 | |
| 241 | item = new JMenuItem(tr("Copy as HTML")); |
| 242 | item.addActionListener(new ActionListener() { |
| 243 | public void actionPerformed(ActionEvent e) { |
| 244 | handleHTMLCopy(); |
| 245 | } |
| 246 | }); |
| 247 | menu.add(item); |
| 248 | |
| 249 | final JMenuItem referenceItem = new JMenuItem(tr("Find in Reference")); |
| 250 | referenceItem.addActionListener(ev -> editor.handleFindReference(getCurrentKeyword())); |
| 251 | menu.add(referenceItem); |
no test coverage detected