Commits

Anonymous committed 6d73793

Making ActionListBox accept Action objects

  • Participants
  • Parent commits 97e99eb

Comments (0)

Files changed (1)

File src/org/lantern/gui/ActionListBox.java

             selectedIndex = 0;
     }
 
+    public void addAction(final Action action)
+    {
+        addItem(new Item() {
+            public String getTitle() {
+                return action.toString();
+            }
+
+            public void doAction() throws LanternException {
+                action.doAction();
+            }
+        });
+    }
+
     public void clearItems()
     {
         itemList.clear();