KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > bluej > editor > EditorManager


1 //Copyright (c) 2000, 2005 BlueJ Group, Deakin University
2
//
3
// This software is made available under the terms of the "MIT License"
4
// A copy of this license is included with this source distribution
5
// in "license.txt" and is also available at:
6
// http://www.opensource.org/licenses/mit-license.html
7
// Any queries should be directed to Michael Kolling mik@bluej.org
8

9 package bluej.editor;
10
11 import java.awt.Rectangle JavaDoc;
12 import java.util.List JavaDoc;
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,v 1.16 2005/05/02 03:23:33 davmac Exp $
22  */

23 public abstract class EditorManager
24 {
25
26     private static EditorManager theEditorManager = new MoeEditorManager();
27
28     /**
29      * Singleton factory method to return an EditorManager instance;
30      *
31      * @returns the singleton EditorManager instance
32      */

33     public static EditorManager getEditorManager()
34     {
35         return theEditorManager;
36     }
37
38
39     /**
40      * Open an editor to display a class. The filename may be "null"
41      * to open an empty editor (e.g. for displaying a view). The editor
42      * is initially hidden. A call to "Editor::show" is needed to make
43      * is visible after opening it.
44      *
45      * @param filename name of the source file to open (may be null)
46      * @param docFilename name of the documentation based on filename
47      * @param windowTitle title of window (usually class name)
48      * @param watcher an object interested in editing events
49      * @param compiled true, if the class has been compiled
50      * @param breakpoints vector of Integers: line numbers where bpts are
51      * @returns the new editor, or null if there was a problem
52      */

53     public abstract Editor openClass(String JavaDoc filename,
54         String JavaDoc docFilename,
55         String JavaDoc windowTitle,
56         EditorWatcher watcher,
57         boolean compiled,
58         List JavaDoc breakpoints,
59         ClassLoader JavaDoc projectClassLoader, Rectangle JavaDoc bounds );
60
61
62     /**
63      * Open an editor to display a text document. The difference to
64      * "openClass" is that code specific functions (such as compile,
65      * debug, view) are disabled in the editor. The filename may be
66      * "null" to open an empty editor. The editor is initially hidden.
67      * A call to "Editor::show" is needed to make is visible after
68      * opening it.
69      *
70      * @param filename name of the source file to open (may be null)
71      * @param windowTitle title of window (usually class name)
72      * @param watcher an object interested in editing events
73      * @returns the new editor, or null if there was a problem
74      */

75     public abstract Editor openText(String JavaDoc filename, String JavaDoc windowTitle,
76                                     Rectangle JavaDoc bounds );
77
78     /**
79      * Indicate to the manager that all resources used by this editor
80      * should be discarded.
81      */

82     protected abstract void discardEditor(Editor ed);
83
84     /**
85      * Refresh the display of all showing editors (usually because
86      * an editor property such as font has changed)
87      */

88     public abstract void refreshAll();
89
90
91 } // end interface EditorManager
92
Popular Tags