KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jline > ConsoleOperations


1 /**
2  * jline - Java console input library
3  * Copyright (c) 2002-2006, Marc Prud'hommeaux <mwp1@cornell.edu>
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or
7  * without modification, are permitted provided that the following
8  * conditions are met:
9  *
10  * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer
15  * in the documentation and/or other materials provided with
16  * the distribution.
17  *
18  * Neither the name of JLine nor the names of its contributors
19  * may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
24  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
26  * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
31  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
33  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
34  * OF THE POSSIBILITY OF SUCH DAMAGE.
35  */

36 package jline;
37
38
39 import java.awt.event.KeyEvent JavaDoc;
40
41
42 /**
43  * Synbolic constants for Console operations and virtual key bindings.
44  *
45  * @see KeyEvent
46  * @author <a HREF="mailto:mwp1@cornell.edu">Marc Prud'hommeaux</a>
47  */

48 public interface ConsoleOperations
49 {
50     final String JavaDoc CR = System.getProperty ("line.separator");
51
52     final char BACKSPACE = '\b';
53     final char RESET_LINE = '\r';
54     final char KEYBOARD_BELL = '\07';
55
56     final char CTRL_A = 1;
57     final char CTRL_B = 2;
58     final char CTRL_C = 3;
59     final char CTRL_D = 4;
60     final char CTRL_E = 5;
61     final char CTRL_F = 6;
62     final char CTRL_N = 14;
63     final char CTRL_P = 16;
64
65
66     /**
67      * Logical constants for key operations.
68      */

69
70     /**
71      * Unknown operation.
72      */

73     final short UNKNOWN = -99;
74
75     /**
76      * Operation that moves to the beginning of the buffer.
77      */

78     final short MOVE_TO_BEG = -1;
79
80     /**
81      * Operation that moves to the end of the buffer.
82      */

83     final short MOVE_TO_END = -3;
84
85     /**
86      * Operation that moved to the previous character in the buffer.
87      */

88     final short PREV_CHAR = -4;
89
90     /**
91      * Operation that issues a newline.
92      */

93     final short NEWLINE = -6;
94
95     /**
96      * Operation that deletes the buffer from the current character to the end.
97      */

98     final short KILL_LINE = -7;
99
100     /**
101      * Operation that clears the screen.
102      */

103     final short CLEAR_SCREEN = -8;
104
105     /**
106      * Operation that sets the buffer to the next history item.
107      */

108     final short NEXT_HISTORY = -9;
109
110     /**
111      * Operation that sets the buffer to the previous history item.
112      */

113     final short PREV_HISTORY = -11;
114
115     /**
116      * Operation that redisplays the current buffer.
117      */

118     final short REDISPLAY = -13;
119
120     /**
121      * Operation that deletes the buffer from the cursor to the beginning.
122      */

123     final short KILL_LINE_PREV = -15;
124
125     /**
126      * Operation that deletes the previous word in the buffer.
127      */

128     final short DELETE_PREV_WORD = -16;
129
130     /**
131      * Operation that moves to the next character in the buffer.
132      */

133     final short NEXT_CHAR = -19;
134
135     /**
136      * Operation that moves to the previous character in the buffer.
137      */

138     final short REPEAT_PREV_CHAR = -20;
139
140     /**
141      * Operation that searches backwards in the command history.
142      */

143     final short SEARCH_PREV = -21;
144
145     /**
146      * Operation that repeats the character.
147      */

148     final short REPEAT_NEXT_CHAR = -24;
149
150     /**
151      * Operation that searches forward in the command history.
152      */

153     final short SEARCH_NEXT = -25;
154
155     /**
156      * Operation that moved to the previous whitespace.
157      */

158     final short PREV_SPACE_WORD = -27;
159
160     /**
161      * Operation that moved to the end of the current word.
162      */

163     final short TO_END_WORD = -29;
164
165     /**
166      * Operation that
167      */

168     final short REPEAT_SEARCH_PREV = -34;
169
170     /**
171      * Operation that
172      */

173     final short PASTE_PREV = -36;
174
175     /**
176      * Operation that
177      */

178     final short REPLACE_MODE = -37;
179
180     /**
181      * Operation that
182      */

183     final short SUBSTITUTE_LINE = -38;
184
185     /**
186      * Operation that
187      */

188     final short TO_PREV_CHAR = -39;
189
190     /**
191      * Operation that
192      */

193     final short NEXT_SPACE_WORD = -40;
194
195     /**
196      * Operation that
197      */

198     final short DELETE_PREV_CHAR = -41;
199
200     /**
201      * Operation that
202      */

203     final short ADD = -42;
204
205     /**
206      * Operation that
207      */

208     final short PREV_WORD = -43;
209
210     /**
211      * Operation that
212      */

213     final short CHANGE_META = -44;
214
215     /**
216      * Operation that
217      */

218     final short DELETE_META = -45;
219
220     /**
221      * Operation that
222      */

223     final short END_WORD = -46;
224
225     /**
226      * Operation that
227      */

228     final short INSERT = -48;
229
230     /**
231      * Operation that
232      */

233     final short REPEAT_SEARCH_NEXT = -49;
234
235     /**
236      * Operation that
237      */

238     final short PASTE_NEXT = -50;
239
240     /**
241      * Operation that
242      */

243     final short REPLACE_CHAR = -51;
244
245     /**
246      * Operation that
247      */

248     final short SUBSTITUTE_CHAR = -52;
249
250     /**
251      * Operation that
252      */

253     final short TO_NEXT_CHAR = -53;
254
255     /**
256      * Operation that undoes the previous operation.
257      */

258     final short UNDO = -54;
259
260     /**
261      * Operation that moved to the next word.
262      */

263     final short NEXT_WORD = -55;
264
265     /**
266      * Operation that deletes the previous character.
267      */

268     final short DELETE_NEXT_CHAR = -56;
269
270     /**
271      * Operation that toggles between uppercase and lowercase.
272      */

273     final short CHANGE_CASE = -57;
274
275     /**
276      * Operation that performs completion operation on the current word.
277      */

278     final short COMPLETE = -58;
279
280     /**
281      * Operation that exits the command prompt.
282      */

283     final short EXIT = -59;
284
285     /**
286      * Operation that pastes the contents of the cliboard into the line
287      */

288     final short PASTE = -60;
289 }
290
291
Popular Tags