(String name)
| 80 | } |
| 81 | |
| 82 | public void createMacro(String name) { |
| 83 | int options = (monospaced?Editor.MONOSPACED:0)+(menuBar?Editor.MENU_BAR:0); |
| 84 | if (name.endsWith(".ijm") || name.endsWith(".js")) |
| 85 | options |= Editor.RUN_BAR; |
| 86 | if (name.endsWith(".ijm")) |
| 87 | options |= Editor.INSTALL_BUTTON; |
| 88 | String text = ""; |
| 89 | ed = new Editor(rows, columns, 0, options); |
| 90 | if (type==TEMPLATE) |
| 91 | text = Tools.openFromIJJarAsString("/macros/"+name); |
| 92 | if (name.endsWith(".src")) |
| 93 | name = name.substring(0,name.length()-4) + ".java"; |
| 94 | if (type==MACRO && !name.endsWith(".ijm")) |
| 95 | name = SaveDialog.setExtension(name, ".ijm"); |
| 96 | else if (type==JAVASCRIPT && !name.endsWith(".js")) { |
| 97 | if (name.equals("Macro")) name = "script"; |
| 98 | name = SaveDialog.setExtension(name, ".js"); |
| 99 | } |
| 100 | if (text!=null) |
| 101 | ed.create(name, text); |
| 102 | } |
| 103 | |
| 104 | void createTable() { |
| 105 | new TextWindow(name, "", tableWidth, tableHeight); |
no test coverage detected