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

Class TextWriter

ij/src/main/java/ij/plugin/TextWriter.java:11–33  ·  view source on GitHub ↗

This plugin implements the File/Save As/Text command, which saves the contents of Editor windows and TextWindows (e.g., "Log" and "Results").

Source from the content-addressed store, hash-verified

9/** This plugin implements the File/Save As/Text command, which saves the
10 contents of Editor windows and TextWindows (e.g., "Log" and "Results"). */
11public class TextWriter implements PlugIn {
12
13 public void run(String arg) {
14 saveText();
15 }
16
17 void saveText() {
18 Frame frame = WindowManager.getFrontWindow();
19 if (frame!=null && (frame instanceof TextWindow)) {
20 TextPanel tp = ((TextWindow)frame).getTextPanel();
21 tp.saveAs("");
22 } else if (frame!=null && (frame instanceof Editor)) {
23 Editor ed = (Editor)frame;
24 ed.saveAs();
25 } else {
26 IJ.error("Save As Text",
27 "This command requires a TextWindow, such\n"
28 + "as the \"Log\" window, or an Editor window. Use\n"
29 + "File>Save>Text Image to save an image as text.");
30 }
31 }
32
33}
34

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected