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


001:        /*
002:         * Marker.java - Named location in a buffer
003:         * :tabSize=8:indentSize=8:noTabs=false:
004:         * :folding=explicit:collapseFolds=1:
005:         *
006:         * Copyright (C) 1998, 1999, 2000, 2001 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;
024:
025:        import javax.swing.text.Position;
026:
027:        /**
028:         * Buffers may contain one or more <i>markers</i> which serve
029:         * as textual bookmarks.<p>
030:         *
031:         * A <code>Marker</code> has three key attributes: the
032:         * <code>Buffer</code> to which it relates, the line number to which
033:         * the marker refers, and an optional shortcut character. The shortcut
034:         * identifies the the key that can be pressed with the
035:         * <b>Markers</b>&gt;<b>Go To Marker</b> command.
036:         *
037:         * @author Slava Pestov
038:         * @author John Gellene (API documentation)
039:         * @version $Id: Marker.java 4469 2003-02-08 18:53:03Z spestov $
040:         */
041:        public class Marker {
042:            //{{{ getShortcut() method
043:            /**
044:             * Returns the marker's shortcut character.
045:             * @since jEdit 3.2pre1
046:             */
047:            public char getShortcut() {
048:                return shortcut;
049:            } //}}}
050:
051:            //{{{ getPosition() method
052:            /**
053:             * Returns the position of this marker.
054:             * @since jEdit 3.2pre1
055:             */
056:            public int getPosition() {
057:                return (position == null ? pos : position.getOffset());
058:            } //}}}
059:
060:            //{{{ Package-private members
061:
062:            //{{{ Marker constructor
063:            Marker(Buffer buffer, char shortcut, int position) {
064:                this .buffer = buffer;
065:                this .shortcut = shortcut;
066:                this .pos = position;
067:            } //}}}
068:
069:            //{{{ setShortcut() method
070:            /**
071:             * Sets the marker's shortcut.
072:             * @param shortcut The new shortcut
073:             * @since jEdit 3.2pre1
074:             */
075:            void setShortcut(char shortcut) {
076:                this .shortcut = shortcut;
077:            } //}}}
078:
079:            //{{{ createPosition() method
080:            void createPosition() {
081:                position = buffer.createPosition(pos);
082:            } //}}}
083:
084:            //{{{ removePosition() method
085:            void removePosition() {
086:                // forget the cached Position instance
087:                if (position != null) {
088:                    pos = position.getOffset();
089:                    position = null;
090:                }
091:            } //}}}
092:
093:            //{{{ setPosition() method
094:            /**
095:             * Sets the position of this marker.
096:             * @since jEdit 4.0pre5
097:             */
098:            void setPosition(int pos) {
099:                this .pos = pos;
100:            } //}}}
101:
102:            //}}}
103:
104:            //{{{ Private members
105:            private Buffer buffer;
106:            private char shortcut;
107:            private int pos;
108:            private Position position;
109:            //}}}
110:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.