home *** CD-ROM | disk | FTP | other *** search
- package netscape.plugin.composer;
-
- import java.io.File;
- import java.io.IOException;
- import java.io.Reader;
- import java.io.Writer;
- import java.net.URL;
-
- class ComposerDocument extends Document {
- private Composer composer;
- private String workDirectory;
- private String text;
- private URL base;
- private URL workDirectoryURL;
- private String eventName;
- private URL documentURL;
- // $FF: renamed from: in netscape.plugin.composer.ComposerDocumentReader
- private ComposerDocumentReader field_0;
- private ComposerDocumentWriter out;
- private PluginManager manager;
-
- public ComposerDocument(Composer var1, String var2, URL var3, String var4, URL var5, String var6, URL var7) {
- this.composer = var1;
- this.text = var2;
- this.workDirectory = var4;
- this.base = var3;
- this.workDirectoryURL = var5;
- this.eventName = var6;
- this.documentURL = var7;
- }
-
- public URL getBase() {
- return this.base;
- }
-
- public File getWorkDirectory() {
- return new File(this.workDirectory);
- }
-
- public URL getWorkDirectoryURL() {
- return this.workDirectoryURL;
- }
-
- public Reader getInput() throws IOException {
- if (this.field_0 != null) {
- throw new IOException("Must close existing input stream first.");
- } else {
- this.field_0 = new ComposerDocumentReader(this, this.text.toCharArray());
- return this.field_0;
- }
- }
-
- public Writer getOutput() throws IOException {
- this.doOutputCheck();
- this.out = new ComposerDocumentWriter(this);
- return this.out;
- }
-
- private void doOutputCheck() throws IOException {
- if (this.out != null) {
- throw new IOException("Must close existing output stream first.");
- }
- }
-
- public String getText() {
- return this.text;
- }
-
- public void setText(String var1) throws IOException {
- this.doOutputCheck();
- this.text = var1;
- this.composer.newText(var1);
- }
-
- void inputDone(ComposerDocumentReader var1) {
- if (var1 == this.field_0) {
- this.field_0 = null;
- }
-
- }
-
- void outputDone(ComposerDocumentWriter var1, String var2) {
- if (var1 == this.out) {
- this.out = null;
-
- try {
- this.setText(var2);
- } catch (IOException var4) {
- System.err.println("Couldn't set text.");
- ((Throwable)var4).printStackTrace();
- }
- }
- }
-
- public URL getDocumentURL() {
- return this.documentURL;
- }
-
- public String getEventName() {
- return this.eventName;
- }
-
- public void redirectDocumentOpen(String var1) {
- if (this.eventName.equals("edit")) {
- this.composer.newText(var1);
- }
-
- }
-
- Composer getComposer() {
- return this.composer;
- }
- }
-