(Base base, String path, EditorState state,
Mode mode)
| 75 | |
| 76 | |
| 77 | protected JavaEditor(Base base, String path, EditorState state, |
| 78 | Mode mode) throws EditorException { |
| 79 | super(base, path, state, mode); |
| 80 | |
| 81 | jmode = (JavaMode) mode; |
| 82 | debugger = new Debugger(this); |
| 83 | inspector = new VariableInspector(this); |
| 84 | |
| 85 | // set breakpoints from marker comments |
| 86 | for (LineID lineID : stripBreakpointComments()) { |
| 87 | //System.out.println("setting: " + lineID); |
| 88 | debugger.setBreakpoint(lineID); |
| 89 | } |
| 90 | // setting breakpoints will flag sketch as modified, so override this here |
| 91 | getSketch().setModified(false); |
| 92 | |
| 93 | hasJavaTabs = checkForJavaTabs(); |
| 94 | |
| 95 | /* |
| 96 | // hack to add a JPanel to the right-hand side of the text area |
| 97 | JPanel textAndError = new JPanel(); |
| 98 | // parent is a vertical box with the toolbar, the header, and the text area |
| 99 | Box box = (Box) textarea.getParent(); |
| 100 | // remove the text area temporarily |
| 101 | box.remove(2); |
| 102 | textAndError.setLayout(new BorderLayout()); |
| 103 | errorColumn = new MarkerColumn(this, textarea.getMinimumSize().height); |
| 104 | textAndError.add(errorColumn, BorderLayout.EAST); |
| 105 | textarea.setBounds(0, 0, errorColumn.getX() - 1, textarea.getHeight()); |
| 106 | textAndError.add(textarea); |
| 107 | // add our hacked version back to the editor |
| 108 | box.add(textAndError); |
| 109 | */ |
| 110 | |
| 111 | preprocessingService = new PreprocessingService(this); |
| 112 | pdex = new PDEX(this, preprocessingService); |
| 113 | |
| 114 | Toolkit.setMenuMnemonics(textarea.getRightClickPopup()); |
| 115 | |
| 116 | // ensure completion is hidden when editor loses focus |
| 117 | addWindowFocusListener(new WindowFocusListener() { |
| 118 | public void windowLostFocus(WindowEvent e) { |
| 119 | getJavaTextArea().hideSuggestion(); |
| 120 | } |
| 121 | |
| 122 | public void windowGainedFocus(WindowEvent e) { } |
| 123 | }); |
| 124 | } |
| 125 | |
| 126 | |
| 127 | public PdePreprocessor createPreprocessor(final String sketchName) { |
nothing calls this directly
no test coverage detected