(Base base, String path, EditorState state,
Mode mode)
| 100 | |
| 101 | |
| 102 | protected JavaEditor(Base base, String path, EditorState state, |
| 103 | Mode mode) throws EditorException { |
| 104 | super(base, path, state, mode); |
| 105 | |
| 106 | // long t1 = System.currentTimeMillis(); |
| 107 | |
| 108 | jmode = (JavaMode) mode; |
| 109 | |
| 110 | debugger = new Debugger(this); |
| 111 | debugger.populateMenu(modeMenu); |
| 112 | |
| 113 | // set breakpoints from marker comments |
| 114 | for (LineID lineID : stripBreakpointComments()) { |
| 115 | //System.out.println("setting: " + lineID); |
| 116 | debugger.setBreakpoint(lineID); |
| 117 | } |
| 118 | // setting breakpoints will flag sketch as modified, so override this here |
| 119 | getSketch().setModified(false); |
| 120 | |
| 121 | preprocService = new PreprocService(this.jmode, this.sketch); |
| 122 | |
| 123 | // long t5 = System.currentTimeMillis(); |
| 124 | |
| 125 | usage = new ShowUsage(this, preprocService); |
| 126 | inspect = new InspectMode(this, preprocService, usage); |
| 127 | rename = new Rename(this, preprocService, usage); |
| 128 | |
| 129 | if (SHOW_AST_VIEWER) { |
| 130 | astViewer = new ASTViewer(this, preprocService); |
| 131 | } |
| 132 | |
| 133 | errorChecker = new ErrorChecker(this::setProblemList, preprocService); |
| 134 | |
| 135 | // long t7 = System.currentTimeMillis(); |
| 136 | |
| 137 | for (SketchCode code : getSketch().getCode()) { |
| 138 | Document document = code.getDocument(); |
| 139 | addDocumentListener(document); |
| 140 | } |
| 141 | sketchChanged(); |
| 142 | |
| 143 | // long t9 = System.currentTimeMillis(); |
| 144 | |
| 145 | Toolkit.setMenuMnemonics(textarea.getRightClickPopup()); |
| 146 | |
| 147 | // ensure completion is hidden when editor loses focus |
| 148 | addWindowFocusListener(new WindowFocusListener() { |
| 149 | public void windowLostFocus(WindowEvent e) { |
| 150 | getJavaTextArea().hideSuggestion(); |
| 151 | } |
| 152 | |
| 153 | public void windowGainedFocus(WindowEvent e) { } |
| 154 | }); |
| 155 | |
| 156 | // long t10 = System.currentTimeMillis(); |
| 157 | // System.out.println("java editor was " + (t10-t9) + " " + (t9-t7) + " " + (t7-t5) + " " + (t5-t1)); |
| 158 | } |
| 159 |
nothing calls this directly
no test coverage detected