Пример #1
0
 public void onAction(int action) {
   switch (action) {
     case Const.ACTION_EDIT:
       super.onAction(Const.ACTION_QUESTION);
       CommonScreen.currentQuestion = new Question();
       CommonScreen.currentQuestion.read(
           true,
           ((GUIList) items.elementAt(0))
               .items.indexOf(((GUIList) items.elementAt(0)).activeItem));
       break;
     case Const.ACTION_DELETECURRENT:
       {
         GUIList list = (GUIList) items.elementAt(0);
         if (list.activeItem != null) {
           GUIControl deletedControl = list.activeItem;
           int recordId = Core.storage.getRecordId("drafts", list.items.indexOf(deletedControl));
           Core.storage.deleteData("drafts", recordId);
           list.up();
           list.items.removeElement(deletedControl);
           onAction(Const.ACTION_POPUP);
         }
       }
       break;
     default:
       super.onAction(action);
       break;
   }
 }
Пример #2
0
 public void onAction(int action) {
   switch (action) {
     case Const.ACTION_DELETECURRENT:
       {
         GUIList list = (GUIList) items.elementAt(0);
         if (list.activeItem != null) {
           GUIControl deletedControl = list.activeItem;
           int recordId = Core.storage.getRecordId("outbox", list.items.indexOf(deletedControl));
           Core.storage.deleteData("outbox", recordId);
           list.up();
           list.items.removeElement(deletedControl);
           onAction(Const.ACTION_POPUP);
         }
       }
       break;
     default:
       super.onAction(action);
       break;
   }
 }