5776805 [rkeene@sledge /home/rkeene/archive/floydssh/telnet]$ cat -n SelectFunctionDlg.java
 1 /* This file is part of "Telnet Floyd".
 2  *
 3  * (c) Radek Polak 2003-2004. All Rights Reserved.
 4  *
 5  * Please visit project homepage at http://phoenix.inf.upol.cz/~polakr
 6  *
 7  * --LICENSE NOTICE--
 8  * This program is free software; you can redistribute it and/or
 9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  * --LICENSE NOTICE--
22  *
23  */
24 
25 package telnet;

26 import javax.microedition.lcdui.*;

27 
28 /**
29  * Dialog, that shows all actions. User selects one which will be binded to some
30  * key.
31  */
32 
33 public class SelectFunctionDlg extends List implements CommandListener {
34 
35   public SelectFunctionDlg() {
36     super("Bind action", List.IMPLICIT);
37     append("cancel",null);
38     append(Action.INPUT_DIALOG,null);
39     append(Action.KEY_TYPED,null);
40     append(Action.CONNECT,null);
41     append(Action.KEY_PRESSED,null);
42     append(Action.TYPE_STRING,null);
43     append(Action.ENTER_STRING,null);
44     append(Action.SCROLL_UP,null);
45     append(Action.SCROLL_DOWN,null);
46     append(Action.SCROLL_LEFT,null);
47     append(Action.SCROLL_RIGH,null);
48     append(Action.SET_SCREEN_SIZE,null);
49     append(Action.TRAFFIC,null);
50     append(Action.BG_COLOR,null);
51     append(Action.FG_COLOR,null);
52     append(Action.VIEW_CONSOLE,null);
53     append(Action.SET_SCOLLBACK_SIZE,null);
54     append(Action.SCOLLBACK_UP,null);
55     append(Action.SCOLLBACK_DOWN,null);
56     append(Action.SHOW_TERMINAL_SIZE,null);
57     append(Action.SHOW_HELP,null);
58     append(Action.SET_SLEEP_TIME, null);
59     append(Action.KEEP_CONNECTION_TIME,null);
60     append(Action.EXIT_APP,null);
61 
62     setCommandListener(this);
63     addCommand(new Command("Bind", Command.SCREEN, 1));
64   }
65 
66   public void commandAction(Command command, Displayable displayable) {
67     if( getSelectedIndex() == 0 )
68       Telnet.setDisplay( Telnet.terminal );
69     else
70     {
71       FuncParamsDlg dlg = new FuncParamsDlg();
72       Telnet.setDisplay(dlg);
73       dlg.setAction(getString(getSelectedIndex()));
74     }
75   }
76 }
77 
78 
79 
5776806 [rkeene@sledge /home/rkeene/archive/floydssh/telnet]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2004-03-06 18:27:38