01: //Copyright (c) 2000, 2005 BlueJ Group, Deakin University
02: //
03: // This software is made available under the terms of the "MIT License"
04: // A copy of this license is included with this source distribution
05: // in "license.txt" and is also available at:
06: // http://www.opensource.org/licenses/mit-license.html
07: // Any queries should be directed to Michael Kolling mik@bluej.org
08:
09: package bluej.editor;
10:
11: import java.awt.Rectangle;
12: import java.util.List;
13: import bluej.editor.moe.MoeEditorManager;
14:
15: /**
16: * Interface between the editor manager and the rest of BlueJ.
17: *
18: * @author Michael Cahill
19: * @author Michael Kolling
20: * @author Bruce Quig
21: * @version $Id: EditorManager.java 5390 2007-11-21 05:06:41Z davmac $
22: */
23: public abstract class EditorManager {
24:
25: private static EditorManager theEditorManager = new MoeEditorManager();
26:
27: /**
28: * Singleton factory method to return an EditorManager instance;
29: *
30: * @returns the singleton EditorManager instance
31: */
32: public static EditorManager getEditorManager() {
33: return theEditorManager;
34: }
35:
36: /**
37: * Open an editor to display a class. The filename may be "null"
38: * to open an empty editor (e.g. for displaying a view). The editor
39: * is initially hidden. A call to "Editor::show" is needed to make
40: * is visible after opening it.
41: *
42: * @param filename name of the source file to open (may be null)
43: * @param docFilename name of the documentation based on filename
44: * @param windowTitle title of window (usually class name)
45: * @param watcher an object interested in editing events
46: * @param compiled true, if the class has been compiled
47: * @param breakpoints vector of Integers: line numbers where bpts are
48: * @return the new editor, or null if there was a problem
49: */
50: public abstract Editor openClass(String filename,
51: String docFilename, String windowTitle,
52: EditorWatcher watcher, boolean compiled, Rectangle bounds);
53:
54: /**
55: * Open an editor to display a text document. The difference to
56: * "openClass" is that code specific functions (such as compile,
57: * debug, view) are disabled in the editor. The filename may be
58: * "null" to open an empty editor. The editor is initially hidden.
59: * A call to "Editor::show" is needed to make is visible after
60: * opening it.
61: *
62: * @param filename name of the source file to open (may be null)
63: * @param windowTitle title of window (usually class name)
64: * @param watcher an object interested in editing events
65: * @returns the new editor, or null if there was a problem
66: */
67: public abstract Editor openText(String filename,
68: String windowTitle, Rectangle bounds);
69:
70: /**
71: * Indicate to the manager that all resources used by this editor
72: * should be discarded.
73: */
74: protected abstract void discardEditor(Editor ed);
75:
76: /**
77: * Refresh the display of all showing editors (usually because
78: * an editor property such as font has changed)
79: */
80: public abstract void refreshAll();
81:
82: } // end interface EditorManager
|