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


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2005 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.jface.text.projection;
011:
012:        import org.eclipse.jface.text.DocumentEvent;
013:        import org.eclipse.jface.text.IDocument;
014:        import org.eclipse.jface.text.SlaveDocumentEvent;
015:
016:        /**
017:         * This event is sent out by an
018:         * {@link org.eclipse.jface.text.projection.ProjectionDocument}when it is
019:         * manipulated. The manipulation is either a content manipulation or a change of
020:         * the projection between the master and the slave. Clients can determine the
021:         * type of change by asking the projection document event for its change type
022:         * (see {@link #getChangeType()}) and comparing it with the predefined types
023:         * {@link #PROJECTION_CHANGE}and {@link #CONTENT_CHANGE}.
024:         * <p>
025:         * Clients are not supposed to create instances of this class. Instances are
026:         * created by {@link org.eclipse.jface.text.projection.ProjectionDocument}
027:         * instances. This class is not intended to be subclassed.</p>
028:         *
029:         * @since 3.0
030:         */
031:        public class ProjectionDocumentEvent extends SlaveDocumentEvent {
032:
033:            /** The change type indicating a projection change */
034:            public final static Object PROJECTION_CHANGE = new Object();
035:            /** The change type indicating a content change */
036:            public final static Object CONTENT_CHANGE = new Object();
037:
038:            /** The change type */
039:            private Object fChangeType;
040:            /** The offset of the change in the master document */
041:            private int fMasterOffset = -1;
042:            /** The length of the change in the master document */
043:            private int fMasterLength = -1;
044:
045:            /**
046:             * Creates a new content change event caused by the given master document
047:             * change. Instances created using this constructor return <code>-1</code>
048:             * when calling <code>getMasterOffset</code> or
049:             * <code>getMasterLength</code>. This information can be obtained by
050:             * accessing the master event.
051:             *
052:             * @param doc the changed projection document
053:             * @param offset the offset in the projection document
054:             * @param length the length in the projection document
055:             * @param text the replacement text
056:             * @param masterEvent the original master event
057:             */
058:            public ProjectionDocumentEvent(IDocument doc, int offset,
059:                    int length, String text, DocumentEvent masterEvent) {
060:                super (doc, offset, length, text, masterEvent);
061:                fChangeType = CONTENT_CHANGE;
062:            }
063:
064:            /**
065:             * Creates a new projection change event for the given properties. Instances
066:             * created with this constructor return the given master document offset and
067:             * length but do not have an associated master document event.
068:             *
069:             * @param doc the projection document
070:             * @param offset the offset in the projection document
071:             * @param length the length in the projection document
072:             * @param text the replacement text
073:             * @param masterOffset the offset in the master document
074:             * @param masterLength the length in the master document
075:             */
076:            public ProjectionDocumentEvent(IDocument doc, int offset,
077:                    int length, String text, int masterOffset, int masterLength) {
078:                super (doc, offset, length, text, null);
079:                fChangeType = PROJECTION_CHANGE;
080:                fMasterOffset = masterOffset;
081:                fMasterLength = masterLength;
082:            }
083:
084:            /**
085:             * Creates a new projection document event for the given properties. The
086:             * projection change is caused by a manipulation of the master document. In
087:             * order to accommodate the master document change, the projection document
088:             * had to change the projection. Instances created with this constructor
089:             * return the given master document offset and length and also have an
090:             * associated master document event.
091:             *
092:             * @param doc the projection document
093:             * @param offset the offset in the projection document
094:             * @param length the length in the projection document
095:             * @param text the replacement text
096:             * @param masterOffset the offset in the master document
097:             * @param masterLength the length in the master document
098:             * @param masterEvent the master document event
099:             */
100:            public ProjectionDocumentEvent(IDocument doc, int offset,
101:                    int length, String text, int masterOffset,
102:                    int masterLength, DocumentEvent masterEvent) {
103:                super (doc, offset, length, text, masterEvent);
104:                fChangeType = PROJECTION_CHANGE;
105:                fMasterOffset = masterOffset;
106:                fMasterLength = masterLength;
107:            }
108:
109:            /**
110:             * Returns the change type of this event. This is either {@link #PROJECTION_CHANGE} or
111:             * {@link #CONTENT_CHANGE}.
112:             *
113:             * @return the change type of this event
114:             */
115:            public Object getChangeType() {
116:                return fChangeType;
117:            }
118:
119:            /**
120:             * Returns the offset of the master document range that has been added or removed in case this
121:             * event describes a projection change, otherwise it returns <code>-1</code>.
122:             *
123:             * @return the master document offset of the projection change or <code>-1</code>
124:             */
125:            public int getMasterOffset() {
126:                return fMasterOffset;
127:            }
128:
129:            /**
130:             * Returns the length of the master document range that has been added or removed in case this event
131:             * describes a projection changed, otherwise <code>-1</code>.
132:             *
133:             * @return the master document length of the projection change or <code>-1</code>
134:             */
135:            public int getMasterLength() {
136:                return fMasterLength;
137:            }
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.