Fix inclusion of lanterna's resources + fix warning
[jvcard.git] / src / be / nikiroo / jvcard / tui / panes / ContactDetailsRaw.java
index 2de99192050af84249affc547dbaa5a073e596d7..5a616b918fd7b3f5804185351dcca97f6cb2b5ae 100644 (file)
@@ -13,7 +13,10 @@ import be.nikiroo.jvcard.resources.enums.StringId;
 import be.nikiroo.jvcard.tui.KeyAction;
 import be.nikiroo.jvcard.tui.KeyAction.DataType;
 import be.nikiroo.jvcard.tui.KeyAction.Mode;
+import be.nikiroo.jvcard.tui.TuiLauncher;
 
+import com.googlecode.lanterna.gui2.MultiWindowTextGUI;
+import com.googlecode.lanterna.gui2.dialogs.ActionListDialogBuilder;
 import com.googlecode.lanterna.input.KeyType;
 
 public class ContactDetailsRaw extends MainContentList {
@@ -114,6 +117,41 @@ public class ContactDetailsRaw extends MainContentList {
                });
                // TODO: ui
                actions.add(new KeyAction(Mode.ASK_USER, 'a', StringId.KEY_ACTION_ADD) {
+                       @Override
+                       public boolean onAction() {
+                               try{
+                               new ActionListDialogBuilder()
+                                               .setTitle("Action List Dialog")
+                                               .setDescription("Choose an item")
+                                               .addAction("First Item", new Runnable() {
+                                                       @Override
+                                                       public void run() {
+                                                               // Do 1st thing...
+                                                       }
+                                               })
+                                               .addAction("Second Item", new Runnable() {
+                                                       @Override
+                                                       public void run() {
+                                                               // Do 2nd thing...
+                                                       }
+                                               })
+                                               .addAction("Third Item", new Runnable() {
+                                                       @Override
+                                                       public void run() {
+                                                               // Do 3rd thing...
+                                                       }
+                                               })
+                                               .build()
+                                               .showDialog(
+                                                               new MultiWindowTextGUI(TuiLauncher.getScreen()));
+                               
+                               return true;
+                               }catch(Exception e){
+                                       e.printStackTrace();
+                                       throw e;
+                               }
+                       }
+
                        @Override
                        public Object getObject() {
                                return contact;