()
| 185 | |
| 186 | |
| 187 | public void setVisible() { |
| 188 | // Space for the editor plus a li'l gap |
| 189 | int roughWidth = getWidth() + 20; |
| 190 | // If no window open, or the editor is at the edge of the screen |
| 191 | Editor editor = base.getActiveEditor(); |
| 192 | if (editor == null) { |
| 193 | setLocationRelativeTo(null); |
| 194 | } else { |
| 195 | Point p = editor.getLocation(); |
| 196 | if (p.x < roughWidth) { |
| 197 | // Center the window on the screen |
| 198 | setLocationRelativeTo(null); |
| 199 | } else { |
| 200 | // Open the window relative to the editor |
| 201 | setLocation(p.x - roughWidth, p.y); |
| 202 | } |
| 203 | } |
| 204 | setVisible(true); |
| 205 | } |
| 206 | |
| 207 | |
| 208 | protected void updateExpanded(JTree tree) { |
no test coverage detected