MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / openFile

Method openFile

ij/src/main/java/ij/text/TextWindow.java:262–284  ·  view source on GitHub ↗
(String path)

Source from the content-addressed store, hash-verified

260 }
261
262 boolean openFile(String path) {
263 OpenDialog od = new OpenDialog("Open Text File...", path);
264 String directory = od.getDirectory();
265 String name = od.getFileName();
266 if (name==null)
267 return false;
268 path = directory + name;
269
270 IJ.showStatus("Opening: " + path);
271 try {
272 BufferedReader r = new BufferedReader(new FileReader(directory + name));
273 load(r);
274 r.close();
275 }
276 catch (Exception e) {
277 IJ.error(e.getMessage());
278 return true;
279 }
280 textPanel.setTitle(name);
281 setTitle(name);
282 IJ.showStatus("");
283 return true;
284 }
285
286 /** Returns a reference to this TextWindow's TextPanel. */
287 public TextPanel getTextPanel() {

Callers 1

TextWindowMethod · 0.95

Calls 8

getDirectoryMethod · 0.95
getFileNameMethod · 0.95
showStatusMethod · 0.95
loadMethod · 0.95
errorMethod · 0.95
closeMethod · 0.65
getMessageMethod · 0.45
setTitleMethod · 0.45

Tested by

no test coverage detected