Source Code Cross Referenced for MoeEditorManager.java in  » IDE » bluej-editor » bluej » editor » moe » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE » bluej editor » bluej.editor.moe 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // Copyright (c) 2000, 2005 BlueJ Group, Deakin University
002:        //
003:        // This software is made available under the terms of the "MIT License"
004:        // A copy of this license is included with this source distribution
005:        // in "license.txt" and is also available at:
006:        // http://www.opensource.org/licenses/mit-license.html 
007:        // Any queries should be directed to Michael Kolling mik@bluej.org
008:
009:        package bluej.editor.moe;
010:
011:        import bluej.Config;
012:        import bluej.editor.Editor;
013:        import bluej.editor.EditorWatcher;
014:
015:        import java.util.Properties;
016:        import java.util.ArrayList;
017:        import java.util.List;
018:        import java.util.Iterator;
019:
020:        import java.awt.*; // Object input, ouput streams
021:
022:        /**
023:         ** @author Michael Kolling
024:         **
025:         **/
026:
027:        public final class MoeEditorManager extends bluej.editor.EditorManager {
028:            // public static variables
029:
030:            protected static MoeEditorManager editorManager; // the manager object itself
031:
032:            // private variables
033:
034:            private Properties resources;
035:            private List editors; // open editors
036:            private Finder finder; // the finder object
037:
038:            // user preferences
039:
040:            private boolean showLineNum;
041:            private boolean showToolBar;
042:
043:            // =========================== PUBLIC METHODS ===========================
044:
045:            public MoeEditorManager() {
046:                editors = new ArrayList(4);
047:                finder = new Finder();
048:
049:                showToolBar = true;
050:                showLineNum = false;
051:
052:                resources = Config.moeUserProps;
053:
054:                editorManager = this ; // make this object publicly available
055:            }
056:
057:            // ------------------------------------------------------------------------
058:            /**
059:             ** Open an editor to display a class. The filename may be "null"
060:             ** to open an empty editor (e.g. for displaying a view). The editor
061:             ** is initially hidden. A call to "Editor::show" is needed to make
062:             ** is visible after opening it.
063:             **
064:             ** @param filename	name of the source file to open (may be null)
065:             ** @param windowTitle	title of window (usually class name)
066:             ** @param watcher	an object interested in editing events
067:             ** @param compiled	true, if the class has been compiled
068:             ** @param breakpoints	list of Integers: line numbers where bpts are
069:             ** @return		the new editor, or null if there was a problem
070:             **/
071:
072:            public Editor openClass(String filename, String docFilename,
073:                    String windowTitle, EditorWatcher watcher,
074:                    boolean compiled, Rectangle bounds) {
075:                return openEditor(filename, docFilename, true, windowTitle,
076:                        watcher, compiled, bounds);
077:            }
078:
079:            // ------------------------------------------------------------------------
080:            /**
081:             ** Open an editor to display a text document. The difference to
082:             ** "openClass" is that code specific functions (such as compile,
083:             ** debug, view) are disabled in the editor. The filename may be
084:             ** "null" to open an empty editor. The editor is initially hidden.
085:             ** A call to "Editor::show" is needed to make is visible after
086:             ** opening it.
087:             **
088:             ** @param filename	name of the source file to open (may be null)
089:             ** @param windowTitle	title of window (usually class name)
090:             ** @returns		the new editor, or null if there was a problem
091:             **/
092:
093:            public Editor openText(String filename, String windowTitle,
094:                    Rectangle bounds) // inherited from EditorManager
095:            {
096:                return openEditor(filename, null, false, windowTitle, null,
097:                        false, bounds);
098:            }
099:
100:            public void refreshAll() {
101:                Iterator e = editors.iterator();
102:
103:                while (e.hasNext()) {
104:                    Editor ed = (Editor) e.next();
105:
106:                    if (ed.isShowing())
107:                        ed.refresh();
108:                }
109:            }
110:
111:            // ------------------------------------------------------------------------
112:            /**
113:             * Sound a beep if the "beep with warning" option is true
114:             */
115:            public void beep() {
116:                if (true) // if beepWarning option is on...
117:                    Toolkit.getDefaultToolkit().beep();
118:            }
119:
120:            // ------------------------------------------------------------------------
121:            /**
122:             * Discard the given editor and leave it to be collected by the garbage
123:             * collector.
124:             */
125:            public void discardEditor(Editor ed) {
126:                ed.close();
127:                editors.remove(ed);
128:            }
129:
130:            // ========================== PACKAGE METHODS ===========================
131:
132:            // ------------------------------------------------------------------------
133:            /**
134:             ** Return the shared finder object
135:             **/
136:
137:            Finder getFinder() {
138:                return finder;
139:            }
140:
141:            // ------------------------------------------------------------------------
142:
143:            // ========================== PRIVATE METHODS ===========================
144:
145:            // ------------------------------------------------------------------------
146:            /**
147:             ** Open an editor to display a class. The filename may be "null"
148:             ** to open an empty editor (e.g. for displaying a view). The editor
149:             ** is initially hidden. A call to "Editor::show" is needed to make
150:             ** is visible after opening it.
151:             **
152:             ** @param filename	name of the source file to open (may be null)
153:             ** @param docFilename	name of the documentation based on filename
154:             ** @param windowTitle	title of window (usually class name)
155:             ** @param watcher	an object interested in editing events
156:             ** @param compiled	true, if the class has been compiled
157:             ** @param bounds	bounds for the editor window
158:             ** @returns		the new editor, or null if there was a problem
159:             **/
160:
161:            private Editor openEditor(String filename, String docFilename,
162:                    boolean isCode, String windowTitle, EditorWatcher watcher,
163:                    boolean compiled, Rectangle bounds) {
164:                MoeEditor editor;
165:
166:                editor = new MoeEditor(windowTitle, isCode, watcher,
167:                        showToolBar, showLineNum, resources);
168:                editors.add(editor);
169:                if (watcher != null && filename == null) // editor for class interface
170:                    return editor;
171:                if (editor.showFile(filename, compiled, docFilename, bounds))
172:                    return editor;
173:                else {
174:                    editor.doClose(); // editor will remove itself
175:                    return null;
176:                }
177:            }
178:
179:        } // end class MoeEditorManager
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.