(String s)
| 3851 | } |
| 3852 | |
| 3853 | void printToWindow(String s) { |
| 3854 | String title = s.substring(1, s.length()-1); |
| 3855 | String s2 = getLastString(); |
| 3856 | boolean isCommand = s2.startsWith("\\"); |
| 3857 | Frame frame = WindowManager.getFrame(title); |
| 3858 | if (frame==null) |
| 3859 | interp.error("Window not found"); |
| 3860 | boolean isEditor = frame instanceof Editor; |
| 3861 | if (!(isEditor || frame instanceof TextWindow)) |
| 3862 | interp.error("Window is not text window"); |
| 3863 | if (isEditor) { |
| 3864 | Editor ed = (Editor)frame; |
| 3865 | ed.setIsMacroWindow(true); |
| 3866 | if (isCommand) |
| 3867 | handleEditorCommand(ed, s2); |
| 3868 | else |
| 3869 | ed.append(s2); |
| 3870 | } else { |
| 3871 | TextWindow tw = (TextWindow)frame; |
| 3872 | if (isCommand) |
| 3873 | handleTextWindowCommand(tw, s2); |
| 3874 | else { |
| 3875 | tw.append(s2); |
| 3876 | TextPanel tp = tw.getTextPanel(); |
| 3877 | if (tp!=null) tp.setResultsTable(null); |
| 3878 | } |
| 3879 | } |
| 3880 | } |
| 3881 | |
| 3882 | void handleEditorCommand(Editor ed, String s) { |
| 3883 | if (s.startsWith("\\Update:")) { |
no test coverage detected