01: package tide.sources;
02:
03: import japa.parser.ast.CompilationUnit;
04: import javax.swing.tree.TreeNode;
05: import tide.syntaxtree.*;
06:
07: /** Simple interface uesd for SourceFile and LibFileItem
08: unifies the search and display of source and class files (libraries).
09: */
10: public interface FileItem extends TreeNode {
11: //will be received from DefMutTN
12: public TreeNode getPreviousSibling();
13:
14: public TreeNode getNextSibling();
15:
16: /** "Hello.java" or "Hallo.class" Used in the tree as display
17: */
18: public String getName();
19:
20: /** "mypack.Hello" used to address the class */
21: public String getJavaName();
22:
23: /** "mypack" is the package name. In the root, also named "unnamed scope", the name is an empty string. */
24: public String getPackageName();
25:
26: public String getContent() throws Exception;
27:
28: public void deleteCachedContent();
29:
30: // replace with line and col, more robust !!
31: public int getCaretLinePosition();
32:
33: public int getCaretColumnPosition();
34:
35: /** Set when clicked, or when leaving a file, so we can jump to the leaved place.
36: */
37: public void setCaretPositionToRemember(int line, int column);
38:
39: /** this returns "Hello" without extension .class or .java.
40: * Also named simple name
41: */
42: public String getJavaPartName();
43:
44: /** Possibilities: source or class file.
45: */
46: public boolean isJavaFile();
47:
48: /** true for directories
49: */
50: public boolean isDirectory();
51:
52: /** A source file is a file with ending ".java"
53: */
54: public boolean isSourceFile();
55:
56: public boolean isIgnored();
57:
58: public boolean isEditable();
59:
60: public boolean hasTextRepresentation(); // class, java, txt
61:
62: /** True if has java classes or sources in this package.
63: only the one that have may be imported (1.5_06) sometimes don't compile otherwise !
64: NOT RECURSE
65: */
66: public boolean hasPackageDirectJavaChilds();
67:
68: public long getLastModified();
69:
70: public long getFileSize();
71:
72: /** used to remove from model after manual sync.
73: */
74: public boolean getHasBeenRemoved();
75:
76: /** Caches the last valid syntax tree for the source file (or decompiled class !)
77: * null if not already parsed. This is a cache, useful for completion, but
78: * no guarantee to exist, can be deleted when memory is needed.
79: */
80: //@Deprecated
81: public SimplifiedSyntaxTree2 getSimplifiedSyntaxTreeIfAlreadyMade();
82:
83: //@Deprecated
84: public void setSimplifiedSyntaxTree(SimplifiedSyntaxTree2 st);
85:
86: public ParserResult getParserResultIfAlreadyMade();
87:
88: public void setParserResult(ParserResult st);
89:
90: /** Helps the GC to recover some memory.
91: */
92: public void liberateResourcesForGC();
93:
94: }
|