Source Code Cross Referenced for CharacterKey.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » keys » 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 » ui workbench » org.eclipse.ui.keys 
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.ui.keys;
011:
012:        import java.util.SortedMap;
013:        import java.util.TreeMap;
014:
015:        import org.eclipse.jface.bindings.keys.IKeyLookup;
016:        import org.eclipse.jface.bindings.keys.KeyLookupFactory;
017:
018:        /**
019:         * <p>
020:         * Instances of <code>CharacterKey</code> represent keys on the keyboard which
021:         * represent unicode characters.
022:         * </p>
023:         * <p>
024:         * <code>CharacterKey</code> objects are immutable. Clients are not permitted
025:         * to extend this class.
026:         * </p>
027:         * 
028:         * @deprecated Please use org.eclipse.jface.bindings.keys.KeyStroke and
029:         *             org.eclipse.jface.bindings.keys.KeyLookupFactory
030:         * @since 3.0
031:         */
032:        public final class CharacterKey extends NaturalKey {
033:
034:            /**
035:             * An internal map used to lookup instances of <code>CharacterKey</code>
036:             * given the formal string representation of a character key.
037:             */
038:            static SortedMap characterKeysByName = new TreeMap();
039:
040:            /**
041:             * The single static instance of <code>CharacterKey</code> which
042:             * represents the backspace key (U+0008).
043:             */
044:            public final static CharacterKey BS;
045:
046:            /**
047:             * The single static instance of <code>CharacterKey</code> which
048:             * represents the carriage return (U+000D) key
049:             */
050:            public final static CharacterKey CR;
051:
052:            /**
053:             * The single static instance of <code>CharacterKey</code> which
054:             * represents the delete (U+007F) key.
055:             */
056:            public final static CharacterKey DEL;
057:
058:            /**
059:             * The single static instance of <code>CharacterKey</code> which
060:             * represents the escape (U+001B) key.
061:             */
062:            public final static CharacterKey ESC;
063:
064:            /**
065:             * The single static instance of <code>CharacterKey</code> which
066:             * represents the form feed (U+000C) key.
067:             */
068:            public final static CharacterKey FF;
069:
070:            /**
071:             * The single static instance of <code>CharacterKey</code> which
072:             * represents the line feed (U+000A) key.
073:             */
074:            public final static CharacterKey LF;
075:
076:            /**
077:             * The single static instance of <code>CharacterKey</code> which
078:             * represents the null (U+0000) key.
079:             */
080:            public final static CharacterKey NUL;
081:
082:            /**
083:             * The single static instance of <code>CharacterKey</code> which
084:             * represents the space (U+0020) key.
085:             */
086:            public final static CharacterKey SPACE;
087:
088:            /**
089:             * The single static instance of <code>CharacterKey</code> which
090:             * represents the tab (U+0009) key.
091:             */
092:            public final static CharacterKey TAB;
093:
094:            /**
095:             * The single static instance of <code>CharacterKey</code> which
096:             * represents the vertical tab (U+000B) key.
097:             */
098:            public final static CharacterKey VT;
099:
100:            /**
101:             * Creates an instance of <code>CharacterKey</code> given a unicode
102:             * character. This method determines the correct name for the key based on
103:             * character. Typically, this name is a string of one-character in length
104:             * equal to the character that this instance represents.
105:             * 
106:             * @param character
107:             *            the character that the resultant <code>CharacterKey</code>
108:             *            instance is to represent.
109:             * @return an instance of <code>CharacterKey</code> representing the
110:             *         character.
111:             */
112:            public static final CharacterKey getInstance(final char character) {
113:                return new CharacterKey(character);
114:            }
115:
116:            static {
117:                final IKeyLookup lookup = KeyLookupFactory.getDefault();
118:                BS = new CharacterKey(lookup
119:                        .formalKeyLookup(IKeyLookup.BS_NAME));
120:                CR = new CharacterKey(lookup
121:                        .formalKeyLookup(IKeyLookup.CR_NAME));
122:                DEL = new CharacterKey(lookup
123:                        .formalKeyLookup(IKeyLookup.DEL_NAME));
124:                ESC = new CharacterKey(lookup
125:                        .formalKeyLookup(IKeyLookup.ESC_NAME));
126:                FF = new CharacterKey(lookup
127:                        .formalKeyLookup(IKeyLookup.FF_NAME));
128:                LF = new CharacterKey(lookup
129:                        .formalKeyLookup(IKeyLookup.LF_NAME));
130:                NUL = new CharacterKey(lookup
131:                        .formalKeyLookup(IKeyLookup.NUL_NAME));
132:                SPACE = new CharacterKey(lookup
133:                        .formalKeyLookup(IKeyLookup.SPACE_NAME));
134:                TAB = new CharacterKey(lookup
135:                        .formalKeyLookup(IKeyLookup.TAB_NAME));
136:                VT = new CharacterKey(lookup
137:                        .formalKeyLookup(IKeyLookup.VT_NAME));
138:
139:                characterKeysByName.put(IKeyLookup.BS_NAME, CharacterKey.BS);
140:                characterKeysByName.put(IKeyLookup.BACKSPACE_NAME,
141:                        CharacterKey.BS);
142:                characterKeysByName.put(IKeyLookup.CR_NAME, CharacterKey.CR);
143:                characterKeysByName.put(IKeyLookup.ENTER_NAME, CharacterKey.CR);
144:                characterKeysByName
145:                        .put(IKeyLookup.RETURN_NAME, CharacterKey.CR);
146:                characterKeysByName.put(IKeyLookup.DEL_NAME, CharacterKey.DEL);
147:                characterKeysByName.put(IKeyLookup.DELETE_NAME,
148:                        CharacterKey.DEL);
149:                characterKeysByName.put(IKeyLookup.ESC_NAME, CharacterKey.ESC);
150:                characterKeysByName.put(IKeyLookup.ESCAPE_NAME,
151:                        CharacterKey.ESC);
152:                characterKeysByName.put(IKeyLookup.FF_NAME, CharacterKey.FF);
153:                characterKeysByName.put(IKeyLookup.LF_NAME, CharacterKey.LF);
154:                characterKeysByName.put(IKeyLookup.NUL_NAME, CharacterKey.NUL);
155:                characterKeysByName.put(IKeyLookup.SPACE_NAME,
156:                        CharacterKey.SPACE);
157:                characterKeysByName.put(IKeyLookup.TAB_NAME, CharacterKey.TAB);
158:                characterKeysByName.put(IKeyLookup.VT_NAME, CharacterKey.VT);
159:            }
160:
161:            /**
162:             * Constructs an instance of <code>CharacterKey</code> given a unicode
163:             * character and a name.
164:             * 
165:             * @param key
166:             *            The key to be wrapped.
167:             */
168:            private CharacterKey(final int key) {
169:                super (key);
170:            }
171:
172:            /**
173:             * Gets the character that this object represents.
174:             * 
175:             * @return the character that this object represents.
176:             */
177:            public final char getCharacter() {
178:                return (char) key;
179:            }
180:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.