Source Code Cross Referenced for FoldHandler.java in  » Swing-Library » jEdit » org » gjt » sp » jedit » buffer » 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 » Swing Library » jEdit » org.gjt.sp.jedit.buffer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * FoldHandler.java - Fold handler interface
003:         * :tabSize=8:indentSize=8:noTabs=false:
004:         * :folding=explicit:collapseFolds=1:
005:         *
006:         * Copyright (C) 2001, 2005 Slava Pestov
007:         *
008:         * This program is free software; you can redistribute it and/or
009:         * modify it under the terms of the GNU General Public License
010:         * as published by the Free Software Foundation; either version 2
011:         * of the License, or any later version.
012:         *
013:         * This program is distributed in the hope that it will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016:         * GNU General Public License for more details.
017:         *
018:         * You should have received a copy of the GNU General Public License
019:         * along with this program; if not, write to the Free Software
020:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
021:         */
022:
023:        package org.gjt.sp.jedit.buffer;
024:
025:        import javax.swing.text.Segment;
026:
027:        /**
028:         * Interface for obtaining the fold level of a specified line.<p>
029:         *
030:         * Plugins can provide fold handlers by defining entries in their
031:         * <code>services.xml</code> files like so:
032:         *
033:         * <pre>&lt;SERVICE CLASS="org.gjt.sp.jedit.buffer.FoldHandler" NAME="<i>name</i>"&gt;
034:         *    new <i>MyFoldHandler<i>();
035:         *&lt;/SERVICE&gt;</pre>
036:         *
037:         * See {@link org.gjt.sp.jedit.ServiceManager} for details.
038:         *
039:         * @author Slava Pestov
040:         * @version $Id: FoldHandler.java 9860 2007-06-27 20:58:22Z kpouer $
041:         * @since jEdit 4.3pre3
042:         */
043:        public abstract class FoldHandler {
044:            /**
045:             * The service type. See {@link org.gjt.sp.jedit.ServiceManager}.
046:             * @since jEdit 4.2pre1
047:             * @deprecated use {@link org.gjt.sp.jedit.ServiceManager.ServiceFoldHandlerProvider}
048:             */
049:            @Deprecated
050:            public static final String SERVICE = "org.gjt.sp.jedit.buffer.FoldHandler";
051:
052:            /** The FoldHandlerProvider. */
053:            public static FoldHandlerProvider foldHandlerProvider;
054:
055:            //{{{ getName() method
056:            /**
057:             * Returns the internal name of this FoldHandler
058:             * @return The internal name of this FoldHandler
059:             * @since jEdit 4.0pre6
060:             */
061:            public String getName() {
062:                return name;
063:            }
064:
065:            //}}}
066:
067:            //{{{ getFoldLevel() method
068:            /**
069:             * Returns the fold level of the specified line.
070:             * @param buffer The buffer in question
071:             * @param lineIndex The line index
072:             * @param seg A segment the fold handler can use to obtain any
073:             * text from the buffer, if necessary
074:             * @return The fold level of the specified line
075:             * @since jEdit 4.0pre1
076:             */
077:            public abstract int getFoldLevel(JEditBuffer buffer, int lineIndex,
078:                    Segment seg);
079:
080:            //}}}
081:
082:            //{{{ equals() method
083:            /**
084:             * Returns if the specified fold handler is equal to this one.
085:             * @param o The object
086:             */
087:            public boolean equals(Object o) {
088:                // Default implementation... subclasses can extend this.
089:                if (o == null)
090:                    return false;
091:                else
092:                    return getClass() == o.getClass();
093:            } //}}}
094:
095:            //{{{ hashCode() method
096:            public int hashCode() {
097:                return getClass().hashCode();
098:            } //}}}
099:
100:            //{{{ getFoldHandler() method
101:            /**
102:             * Returns the fold handler with the specified name, or null if
103:             * there is no registered handler with that name.
104:             * @param name The name of the desired fold handler
105:             * @since jEdit 4.0pre6
106:             */
107:            public static FoldHandler getFoldHandler(String name) {
108:                return foldHandlerProvider.getFoldHandler(name);
109:            }
110:
111:            //}}}
112:
113:            //{{{ getFoldModes() method
114:            /**
115:             * Returns an array containing the names of all registered fold
116:             * handlers.
117:             *
118:             * @since jEdit 4.0pre6
119:             */
120:            public static String[] getFoldModes() {
121:                return foldHandlerProvider.getFoldModes();
122:            }
123:
124:            //}}}
125:
126:            //{{{ FoldHandler() constructor
127:            protected FoldHandler(String name) {
128:                this .name = name;
129:            }
130:
131:            //}}}
132:
133:            //{{{ toString() method
134:            public String toString() {
135:                return name;
136:            } //}}}
137:
138:            private String name;
139:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.