retrofit
[nikiroo-utils.git] / src / jexer / TList.java
index 253e40972a49ab133211bdff156708163b08eec8..6b0a205bf422e2bd18cc186f226777d6c0c98084 100644 (file)
@@ -335,21 +335,28 @@ public class TList extends TScrollableWidget {
     @Override
     public void setWidth(final int width) {
         super.setWidth(width);
-        hScroller.setWidth(getWidth() - 1);
-        vScroller.setX(getWidth() - 1);
+        if (hScroller != null) {
+            hScroller.setWidth(getWidth() - 1);
+        }
+        if (vScroller != null) {
+            vScroller.setX(getWidth() - 1);
+        }
     }
 
     /**
      * Override TWidget's height: we need to set child widget heights.
-     * time.
      *
      * @param height new widget height
      */
     @Override
     public void setHeight(final int height) {
         super.setHeight(height);
-        hScroller.setY(getHeight() - 1);
-        vScroller.setHeight(getHeight() - 1);
+        if (hScroller != null) {
+            hScroller.setY(getHeight() - 1);
+        }
+        if (vScroller != null) {
+            vScroller.setHeight(getHeight() - 1);
+        }
     }
 
     /**
@@ -507,7 +514,7 @@ public class TList extends TScrollableWidget {
         assert (selectedString >= 0);
         assert (selectedString < strings.size());
         if (enterAction != null) {
-            enterAction.DO();
+            enterAction.DO(this);
         }
     }
 
@@ -518,7 +525,7 @@ public class TList extends TScrollableWidget {
         assert (selectedString >= 0);
         assert (selectedString < strings.size());
         if (moveAction != null) {
-            moveAction.DO();
+            moveAction.DO(this);
         }
     }
 
@@ -529,7 +536,7 @@ public class TList extends TScrollableWidget {
         assert (selectedString >= 0);
         assert (selectedString < strings.size());
         if (singleClickAction != null) {
-            singleClickAction.DO();
+            singleClickAction.DO(this);
         }
     }