return null;
}
+ /**
+ * Get the maximum selection index value.
+ *
+ * @return -1 if the list is empty
+ */
+ public final int getMaxSelectedIndex() {
+ return strings.size() - 1;
+ }
+
/**
* Set the new list of strings to display.
*
&& (mouse.getY() < getHeight() - 1)) {
if (getVerticalValue() + mouse.getY() < strings.size()) {
selectedString = getVerticalValue() + mouse.getY();
- dispatchEnter();
}
return;
}
super.onMouseDown(mouse);
}
+ /**
+ * Handle mouse double click.
+ *
+ * @param mouse mouse double click event
+ */
+ @Override
+ public void onMouseDoubleClick(final TMouseEvent mouse) {
+ if ((mouse.getX() < getWidth() - 1)
+ && (mouse.getY() < getHeight() - 1)) {
+ if (getVerticalValue() + mouse.getY() < strings.size()) {
+ selectedString = getVerticalValue() + mouse.getY();
+ dispatchEnter();
+ }
+ return;
+ }
+
+ // Pass to children
+ super.onMouseDoubleClick(mouse);
+ }
+
/**
* Handle keystrokes.
*