Source Code Cross Referenced for Navigator.java in  » UML » jrefactory » org » acm » seguin » ide » jedit » 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 » UML » jrefactory » org.acm.seguin.ide.jedit 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:            This program is free software; you can redistribute it and/or
003:            modify it under the terms of the GNU General Public License
004:            as published by the Free Software Foundation; either version 2
005:            of the License, or any later version.
006:            This program is distributed in the hope that it will be useful,
007:            but WITHOUT ANY WARRANTY; without even the implied warranty of
008:            MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
009:            GNU General Public License for more detaProjectTreeSelectionListenerils.
010:            You should have received a copy of the GNU General Public License
011:            along with this program; if not, write to the Free Software
012:            Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
013:         */
014:        package org.acm.seguin.ide.jedit;
015:
016:        import javax.swing.JScrollPane;
017:        import javax.swing.tree.*;
018:
019:        import net.sourceforge.jrefactory.ast.*;
020:
021:        // JRefactory imports
022:        import org.gjt.sp.jedit.Buffer;
023:        import org.gjt.sp.jedit.EBComponent;
024:        import org.gjt.sp.jedit.EBMessage;
025:        import org.gjt.sp.jedit.View;
026:        import org.gjt.sp.jedit.buffer.BufferChangeListener;
027:        import org.gjt.sp.jedit.jEdit;
028:        import org.gjt.sp.jedit.msg.*;
029:        import org.gjt.sp.util.Log;
030:
031:        /**
032:         *  Main GUI for JRefactory
033:         *
034:         * @author     <a href="mailto:JRefactoryPlugin@ladyshot.demon.co.uk">Mike Atkinson</a>
035:         * @since      0.0.1
036:         * @created    23 July 2003
037:         * @version    $Id: Navigator.java,v 1.5 2003/12/02 23:39:37 mikeatkinson Exp $
038:         */
039:        public final class Navigator extends JScrollPane implements 
040:                BufferChangeListener, EBComponent {
041:            private View view;
042:            private org.acm.seguin.ide.common.Navigator navigator;
043:
044:            /**
045:             *  Constructor for the Navigator object
046:             *
047:             * @param  aView  Description of Parameter
048:             * @since         v 1.0
049:             */
050:            public Navigator(View aView) {
051:                this .view = aView;
052:                navigator = new org.acm.seguin.ide.common.Navigator(view);
053:                navigator.viewCreated(view);
054:                Buffer[] buffers = jEdit.getBuffers();
055:                for (int i = 0; i < buffers.length; i++) {
056:                    navigator.addBuffer(buffers[i]);
057:                }
058:                JavaStylePlugin.addNavigator(this );
059:                //add(new JScrollPane(navigator), BorderLayout.CENTER);
060:                setViewportView(navigator);
061:                Buffer buffer = aView.getBuffer();
062:                addBufferChangeListener(buffer, this );
063:            }
064:
065:            /**
066:             *  Description of the Method
067:             *
068:             * @param  msg  Description of the Parameter
069:             * @since       v 1.0
070:             */
071:            public void handleMessage(EBMessage msg) {
072:                System.out.println("Navigator: handleMessage(" + msg + ")");
073:                try {
074:                    if (msg instanceof  ViewUpdate) {
075:                        ViewUpdate update = (ViewUpdate) msg;
076:                        System.out.println("Navigator.handleMessage(" + update
077:                                + ")");
078:                        if (update.getWhat() == ViewUpdate.CREATED) {
079:                            navigator.viewCreated(update.getView());
080:                        } else if (update.getWhat() == ViewUpdate.CLOSED) {
081:                            navigator.viewClosed(update.getView());
082:                        }
083:                    } else if (msg instanceof  BufferUpdate) {
084:                        BufferUpdate update = (BufferUpdate) msg;
085:                        System.out.println("Navigator.handleMessage(" + update
086:                                + ")");
087:                        String name = update.getBuffer().getName()
088:                                .toLowerCase();
089:                        if (name.endsWith(".java")) {
090:                            Buffer buffer = update.getBuffer();
091:                            if (update.getWhat() == BufferUpdate.CREATED) {
092:                                Log.log(Log.MESSAGE, this , "created buffer "
093:                                        + name);
094:                                navigator.addBuffer(buffer);
095:                                addBufferChangeListener(buffer, this );
096:                            } else if (update.getWhat() == BufferUpdate.SAVED) {
097:                                Log.log(Log.MESSAGE, this , "saving buffer "
098:                                        + name);
099:                                navigator.addBuffer(buffer);
100:                                addBufferChangeListener(buffer, this );
101:                            } else if (update.getWhat() == BufferUpdate.CLOSED) {
102:                                Log.log(Log.MESSAGE, this , "removing buffer "
103:                                        + name);
104:                                navigator.removeBuffer(buffer);
105:                                buffer.removeBufferChangeListener(this );
106:                            } else if (update.getWhat() == BufferUpdate.LOADED) {
107:                                Log.log(Log.MESSAGE, this , "loaded buffer "
108:                                        + name);
109:                                navigator.addBuffer(buffer);
110:                                addBufferChangeListener(buffer, this );
111:                            } else if (update.getWhat() == BufferUpdate.DIRTY_CHANGED) {
112:                                Log.log(Log.MESSAGE, this ,
113:                                        "dirty changed buffer " + name);
114:                                navigator.addBuffer(buffer);
115:                                addBufferChangeListener(buffer, this );
116:                            }
117:                        }
118:                        //} else if (msg instanceof EditPaneUpdate) {
119:                        //EditPaneUpdate epu = (EditPaneUpdate)msg;
120:                        //View view = epu.getEditPane().getView();
121:                        //Navigation nav = (Navigation)(viewToNavigation.get(view));
122:                        //if (nav != null) {
123:                        /*
124:                            if (epu.getWhat() == EditPaneUpdate.BUFFER_CHANGED &&
125:                                Config.FLUSH_CACHE_ON_BUFFER_CHANGE.getAsBoolean()){
126:                                //logger.msg("****buffer.changed", epu.toString());
127:                                flushCacheForBuffer(view);
128:                            }
129:                         */
130:                        //}
131:                    } else if (msg instanceof  PropertiesChanged) {
132:                        navigator.reconfigure();
133:                        /*
134:                        } else if (msg instanceof ContextUpdateMessage) {
135:                        if (ClassPathSrcMgr.isAntHelperSrc()){
136:                            ClassPathSrcMgr.getInstance().reload();
137:                        }
138:                         */
139:                    }
140:                } catch (Exception e) {
141:                    e.printStackTrace();
142:                }
143:            }
144:
145:            private void addBufferChangeListener(Buffer buffer, Navigator nav) {
146:                BufferChangeListener[] listeners = buffer
147:                        .getBufferChangeListeners();
148:                for (int i = 0; i < listeners.length; i++) {
149:                    if (listeners[i] == nav) {
150:                        return;
151:                    }
152:                }
153:                buffer.addBufferChangeListener(nav);
154:            }
155:
156:            /**
157:             *  Description of the Method
158:             *
159:             * @param  buffer     Description of Parameter
160:             * @param  startLine  Description of Parameter
161:             * @param  offset     Description of Parameter
162:             * @param  numLines   Description of Parameter
163:             * @param  length     Description of Parameter
164:             * @since             v 1.0
165:             */
166:            public void preContentInserted(Buffer buffer, int startLine,
167:                    int offset, int numLines, int length) {
168:            }
169:
170:            /**
171:             *  Description of the Method
172:             *
173:             * @param  buffer     Description of Parameter
174:             * @param  startLine  Description of Parameter
175:             * @param  offset     Description of Parameter
176:             * @param  numLines   Description of Parameter
177:             * @param  length     Description of Parameter
178:             * @since             v 1.0
179:             */
180:            public void contentInserted(Buffer buffer, int startLine,
181:                    int offset, int numLines, int length) {
182:                navigator.contentInserted(view, buffer, offset, length);
183:            }
184:
185:            /**
186:             *  Description of the Method
187:             *
188:             * @param  buffer     Description of Parameter
189:             * @param  startLine  Description of Parameter
190:             * @param  offset     Description of Parameter
191:             * @param  numLines   Description of Parameter
192:             * @param  length     Description of Parameter
193:             * @since             v 1.0
194:             */
195:            public void preContentRemoved(Buffer buffer, int startLine,
196:                    int offset, int numLines, int length) {
197:            }
198:
199:            /**
200:             *  Description of the Method
201:             *
202:             * @param  buffer     Description of Parameter
203:             * @param  startLine  Description of Parameter
204:             * @param  offset     Description of Parameter
205:             * @param  numLines   Description of Parameter
206:             * @param  length     Description of Parameter
207:             * @since             v 1.0
208:             */
209:            public void contentRemoved(Buffer buffer, int startLine,
210:                    int offset, int numLines, int length) {
211:                navigator.contentRemoved(view, buffer, offset, length);
212:            }
213:
214:            /**
215:             *  Description of the Method
216:             *
217:             * @param  buffer     Description of Parameter
218:             * @param  startLine  Description of Parameter
219:             * @param  endLine    Description of Parameter
220:             * @since             v 1.0
221:             */
222:            public void foldLevelChanged(Buffer buffer, int startLine,
223:                    int endLine) {
224:            }
225:
226:            /**
227:             *  Description of the Method
228:             *
229:             * @param  buffer  Description of Parameter
230:             * @since          v 1.0
231:             */
232:            public void wrapModeChanged(Buffer buffer) {
233:            }
234:
235:            /**
236:             *  Description of the Method
237:             *
238:             * @param  buffer  Description of Parameter
239:             * @since          v 1.0
240:             */
241:            public void foldHandlerChanged(Buffer buffer) {
242:            }
243:
244:            /**
245:             *  Description of the Method
246:             *
247:             * @param  buffer  Description of Parameter
248:             * @since          v 1.0
249:             */
250:            public void transactionComplete(Buffer buffer) {
251:                navigator.transactionComplete(view, buffer);
252:            }
253:
254:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.