106 |
106 |
107 private Command cmdExit = new Command("Exit", Command.EXIT, 1); |
107 private Command cmdExit = new Command("Exit", Command.EXIT, 1); |
108 |
108 |
109 //maximum size which is specified while creating TextBox |
109 //maximum size which is specified while creating TextBox |
110 private final int MAX_SIZE = 100; |
110 private final int MAX_SIZE = 100; |
|
111 |
|
112 //Commands for the item specific options menu. |
|
113 private Command cmdScreen1 = new Command("1 item cmd", Command.SCREEN, 1); |
|
114 private Command cmdScreen2 = new Command("1 ok cmd", Command.SCREEN, 1); |
|
115 private Command cmdScreen3 = new Command("1 item 1 ok cmd", Command.SCREEN, 1); |
|
116 private Command cmdScreen4 = new Command("0 item 0 ok cmd", Command.SCREEN, 1); |
|
117 private Command cmdItemC = new Command("Item command", Command.ITEM, 1); |
|
118 private Command cmdOkC = new Command("Ok command", Command.OK, 1); |
111 |
119 |
112 /** |
120 /** |
113 * |
121 * |
114 * @param parent The parent MIDlet of this class |
122 * @param parent The parent MIDlet of this class |
115 */ |
123 */ |
329 addUneditableTextBoxTest2("URL|PWD|UNEDITABLE", TextField.URL|TextField.PASSWORD|TextField.UNEDITABLE); |
337 addUneditableTextBoxTest2("URL|PWD|UNEDITABLE", TextField.URL|TextField.PASSWORD|TextField.UNEDITABLE); |
330 else if (element.equals(listElements[26])) |
338 else if (element.equals(listElements[26])) |
331 addUneditableTextBoxTest2("EMAILADDR|PWD|UNDEDITABLE", TextField.EMAILADDR|TextField.PASSWORD|TextField.UNEDITABLE); |
339 addUneditableTextBoxTest2("EMAILADDR|PWD|UNDEDITABLE", TextField.EMAILADDR|TextField.PASSWORD|TextField.UNEDITABLE); |
332 else if (element.equals(listElements[27])) |
340 else if (element.equals(listElements[27])) |
333 addNumericUneditableTextBoxTest2("PNO|PWD|UNDEDITABLE", TextField.PHONENUMBER|TextField.PASSWORD|TextField.UNEDITABLE); |
341 addNumericUneditableTextBoxTest2("PNO|PWD|UNDEDITABLE", TextField.PHONENUMBER|TextField.PASSWORD|TextField.UNEDITABLE); |
|
342 |
|
343 tb2.addCommand(cmdScreen1); |
|
344 tb2.addCommand(cmdScreen2); |
|
345 tb2.addCommand(cmdScreen3); |
|
346 tb2.addCommand(cmdScreen4); |
|
347 tb2.setCommandListener(this); |
334 } |
348 } |
335 else if (c == cmdTest3) |
349 else if (c == cmdTest3) |
336 addFormTest3(); |
350 addFormTest3(); |
337 else if (c == cmdGetMaxSize) |
351 else if (c == cmdGetMaxSize) |
338 { |
352 { |
348 else if (c == cmdShowTextBox3) |
362 else if (c == cmdShowTextBox3) |
349 { |
363 { |
350 tb3.setTitle(titleT.getString()); |
364 tb3.setTitle(titleT.getString()); |
351 Display.getDisplay(parent).setCurrent(tb3); |
365 Display.getDisplay(parent).setCurrent(tb3); |
352 } |
366 } |
|
367 else if (c == cmdScreen1) |
|
368 { |
|
369 tb2.removeCommand(cmdOkC); |
|
370 tb2.addCommand(cmdItemC); |
|
371 tb2.setTitle("TextBox"); |
|
372 } |
|
373 else if (c == cmdScreen2) |
|
374 { |
|
375 tb2.removeCommand(cmdItemC); |
|
376 tb2.addCommand(cmdOkC); |
|
377 tb2.setTitle("TextBox"); |
|
378 } |
|
379 else if (c == cmdScreen3) |
|
380 { |
|
381 tb2.addCommand(cmdItemC); |
|
382 tb2.addCommand(cmdOkC); |
|
383 tb2.setTitle("TextBox"); |
|
384 } |
|
385 else if (c == cmdScreen4) |
|
386 { |
|
387 tb2.removeCommand(cmdItemC); |
|
388 tb2.removeCommand(cmdOkC); |
|
389 tb2.setTitle("TextBox"); |
|
390 } |
|
391 else if (c == cmdItemC) |
|
392 { |
|
393 tb2.setTitle("Item command executed."); |
|
394 } |
|
395 else if (c == cmdOkC) |
|
396 { |
|
397 tb2.setTitle("Ok command executed."); |
|
398 } |
353 else if (c == cmdExit) |
399 else if (c == cmdExit) |
354 { |
400 { |
355 parent.destroyApp(false); |
401 parent.destroyApp(false); |
356 parent.notifyDestroyed(); |
402 parent.notifyDestroyed(); |
357 } |
403 } |