1 package com.explosion.expfmodules.texteditor;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 /***
23 * @author Stephen Cowx
24 * Date created:@06-Feb-2003
25 */
26
27 import java.io.File;
28
29 public class TextDocument
30 {
31 private File file;
32 private int documentNumber = -1;
33 private String documentName;
34
35 public TextDocument(File file)
36 {
37 this.file = file;
38 this.documentName = file.getName();
39 }
40
41 public TextDocument(int documentNumber, String extension)
42 {
43 this.documentNumber = documentNumber;
44 this.documentName = "Untitled" + documentNumber + ( extension.indexOf(".")>0 ? "." : "") + extension;
45 }
46
47 public void setFile(File file)
48 {
49 this.file = file;
50 }
51
52 public File getFile()
53 {
54 return this.file;
55 }
56
57 public int getDocumentNumber()
58 {
59 return this.documentNumber;
60 }
61
62 public void setDocumentNumber(int documentNumber)
63 {
64 this.documentNumber = documentNumber;
65 }
66
67 public String getDocumentName()
68 {
69 return this.documentName;
70 }
71
72 public void setDocumentName(String documentName)
73 {
74 this.documentName = documentName;
75 }
76
77 }