package ij.plugin;
import ij.*;
import ij.process.*;
import ij.text.*;
import ij.plugin.frame.Editor;
import java.awt.*;

/** This plugin implements the File/Save As/Text command, which saves the
    contents of Editor windows and TextWindows (e.g., "Log" and "Results"). */
public class TextWriter implements PlugIn {
    public void run(String arg) {
    void saveText() {
        Frame frame = WindowManager.getFrontWindow();
        if (frame!=null && (frame instanceof TextWindow)) {
            TextPanel tp = ((TextWindow)frame).getTextPanel();
        } else if (frame!=null && (frame instanceof Editor)) {
            Editor ed = (Editor)frame;
        } else {
            IJ.error("Save As Text",
                "This command requires a TextWindow, such\n"
                + "as the \"Log\" window, or an Editor window. Use\n"
                + "File>Save>Text Image to save an image as text.");