Source Code Cross Referenced for TextEditVisitor.java in  » IDE-Eclipse » text » org » eclipse » text » edits » 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 Eclipse » text » org.eclipse.text.edits 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.text.edits;
011:
012:        /**
013:         * A visitor for text edits.
014:         * <p>
015:         * For each different concrete text edit type <it>T</it> there is a method:
016:         * <ul>
017:         *   <li><code>public boolean visit(<it>T</it> node)</code> - Visits the given edit to
018:         *   perform some arbitrary operation. If <code>true </code> is returned, the given edit's
019:         *   child edits will be visited next; however, if <code>false</code> is returned, the
020:         *   given edit's child edits will not be visited. The default implementation provided by
021:         *   this class calls a generic method <code>visitNode(<it>TextEdit</it> node)</code>.
022:         *   Subclasses may reimplement these method as needed.</li>
023:         * </ul>
024:         * </p>
025:         * <p>
026:         * In addition, there are methods for visiting text edits in the
027:         * abstract, regardless of node type:
028:         * <ul>
029:         *   <li><code>public void preVisit(TextEdit edit)</code> - Visits
030:         *   the given edit to perform some arbitrary operation.
031:         *   This method is invoked prior to the appropriate type-specific
032:         *   <code>visit</code> method.
033:         *   The default implementation of this method does nothing.
034:         *   Subclasses may reimplement this method as needed.</li>
035:         *
036:         *   <li><code>public void postVisit(TextEdit edit)</code> - Visits
037:         *   the given edit to perform some arbitrary operation.
038:         *   This method is invoked after the appropriate type-specific
039:         *   <code>endVisit</code> method.
040:         *   The default implementation of this method does nothing.
041:         *   Subclasses may reimplement this method as needed.</li>
042:         * </ul>
043:         * </p>
044:         * <p>
045:         * For edits with children, the child nodes are visited in increasing order.
046:         * </p>
047:         *
048:         * @see TextEdit#accept(TextEditVisitor)
049:         * @since 3.0
050:         */
051:        public class TextEditVisitor {
052:
053:            /**
054:             * Visits the given text edit prior to the type-specific visit.
055:             * (before <code>visit</code>).
056:             * <p>
057:             * The default implementation does nothing. Subclasses may reimplement.
058:             * </p>
059:             *
060:             * @param edit the node to visit
061:             */
062:            public void preVisit(TextEdit edit) {
063:                // default implementation: do nothing
064:            }
065:
066:            /**
067:             * Visits the given text edit following the type-specific visit
068:             * (after <code>endVisit</code>).
069:             * <p>
070:             * The default implementation does nothing. Subclasses may reimplement.
071:             * </p>
072:             *
073:             * @param edit the node to visit
074:             */
075:            public void postVisit(TextEdit edit) {
076:                // default implementation: do nothing
077:            }
078:
079:            /**
080:             * Visits the given text edit. This method is called by default from
081:             * type-specific visits. It is not called by an edit's accept method.
082:             * The default implementation returns <code>true</code>.
083:             *
084:             * @param edit the node to visit
085:             * @return If <code>true</code> is returned, the given node's child
086:             *  nodes will be visited next; however, if <code>false</code> is
087:             *  returned, the given node's child nodes will not be visited.
088:             */
089:            public boolean visitNode(TextEdit edit) {
090:                return true;
091:            }
092:
093:            /**
094:             * Visits a <code>CopySourceEdit</code> instance.
095:             *
096:             * @param edit the node to visit
097:             * @return If <code>true</code> is returned, the given node's child
098:             *  nodes will be visited next; however, if <code>false</code> is
099:             *  returned, the given node's child nodes will not be visited.
100:             */
101:            public boolean visit(CopySourceEdit edit) {
102:                return visitNode(edit);
103:            }
104:
105:            /**
106:             * Visits a <code>CopyTargetEdit</code> instance.
107:             *
108:             * @param edit the node to visit
109:             * @return If <code>true</code> is returned, the given node's child
110:             *  nodes will be visited next; however, if <code>false</code> is
111:             *  returned, the given node's child nodes will not be visited.
112:             */
113:            public boolean visit(CopyTargetEdit edit) {
114:                return visitNode(edit);
115:            }
116:
117:            /**
118:             * Visits a <code>MoveSourceEdit</code> instance.
119:             *
120:             * @param edit the node to visit
121:             * @return If <code>true</code> is returned, the given node's child
122:             *  nodes will be visited next; however, if <code>false</code> is
123:             *  returned, the given node's child nodes will not be visited.
124:             */
125:            public boolean visit(MoveSourceEdit edit) {
126:                return visitNode(edit);
127:            }
128:
129:            /**
130:             * Visits a <code>MoveTargetEdit</code> instance.
131:             *
132:             * @param edit the node to visit
133:             * @return If <code>true</code> is returned, the given node's child
134:             *  nodes will be visited next; however, if <code>false</code> is
135:             *  returned, the given node's child nodes will not be visited.
136:             */
137:            public boolean visit(MoveTargetEdit edit) {
138:                return visitNode(edit);
139:            }
140:
141:            /**
142:             * Visits a <code>RangeMarker</code> instance.
143:             *
144:             * @param edit the node to visit
145:             * @return If <code>true</code> is returned, the given node's child
146:             *  nodes will be visited next; however, if <code>false</code> is
147:             *  returned, the given node's child nodes will not be visited.
148:             */
149:            public boolean visit(RangeMarker edit) {
150:                return visitNode(edit);
151:            }
152:
153:            /**
154:             * Visits a <code>CopyingRangeMarker</code> instance.
155:             *
156:             * @param edit the node to visit
157:             * @return If <code>true</code> is returned, the given node's child
158:             *  nodes will be visited next; however, if <code>false</code> is
159:             *  returned, the given node's child nodes will not be visited.
160:             */
161:            public boolean visit(CopyingRangeMarker edit) {
162:                return visitNode(edit);
163:            }
164:
165:            /**
166:             * Visits a <code>DeleteEdit</code> instance.
167:             *
168:             * @param edit the node to visit
169:             * @return If <code>true</code> is returned, the given node's child
170:             *  nodes will be visited next; however, if <code>false</code> is
171:             *  returned, the given node's child nodes will not be visited.
172:             */
173:            public boolean visit(DeleteEdit edit) {
174:                return visitNode(edit);
175:            }
176:
177:            /**
178:             * Visits a <code>InsertEdit</code> instance.
179:             *
180:             * @param edit the node to visit
181:             * @return If <code>true</code> is returned, the given node's child
182:             *  nodes will be visited next; however, if <code>false</code> is
183:             *  returned, the given node's child nodes will not be visited.
184:             */
185:            public boolean visit(InsertEdit edit) {
186:                return visitNode(edit);
187:            }
188:
189:            /**
190:             * Visits a <code>ReplaceEdit</code> instance.
191:             *
192:             * @param edit the node to visit
193:             * @return If <code>true</code> is returned, the given node's child
194:             *  nodes will be visited next; however, if <code>false</code> is
195:             *  returned, the given node's child nodes will not be visited.
196:             */
197:            public boolean visit(ReplaceEdit edit) {
198:                return visitNode(edit);
199:            }
200:
201:            /**
202:             * Visits a <code>UndoEdit</code> instance.
203:             *
204:             * @param edit the node to visit
205:             * @return If <code>true</code> is returned, the given node's child
206:             *  nodes will be visited next; however, if <code>false</code> is
207:             *  returned, the given node's child nodes will not be visited.
208:             */
209:            public boolean visit(UndoEdit edit) {
210:                return visitNode(edit);
211:            }
212:
213:            /**
214:             * Visits a <code>MultiTextEdit</code> instance.
215:             *
216:             * @param edit the node to visit
217:             * @return If <code>true</code> is returned, the given node's child
218:             *  nodes will be visited next; however, if <code>false</code> is
219:             *  returned, the given node's child nodes will not be visited.
220:             */
221:            public boolean visit(MultiTextEdit edit) {
222:                return visitNode(edit);
223:            }
224:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.