/**
*
- * TODO needs major refactoring to be easily expandable TODO add new items TODO
- * null selections
+ * TODO needs major refactoring (to be extensible etc)
*/
public class IFilterSelect extends Composite implements Paintable,
KeyboardListener, ClickListener {
menu.setHeight("");
menu.setWidth("");
offsetHeight = getOffsetHeight();
+
+ offsetWidth = getOffsetWidth();
+ int desiredWidth = IFilterSelect.this.getOffsetWidth() - popupOpener.getOffsetWidth();
+ if(offsetWidth < desiredWidth) {
+ menu.setWidth(desiredWidth + "px");
+ }
+
if (!isPagingEnabled && offsetHeight > Window.getClientHeight()) {
offsetHeight = Window.getClientHeight();
menu.setHeight((offsetHeight - EXTRASPACE) + "px");
DOM.setStyleAttribute(menu.getElement(), "overflow", "auto");
+
// add scrollbar width
menu
.setWidth((menu.getOffsetWidth() * 2 - DOM
}
suggestionPopup.hide();
}
+
+ public void setWidth(String width) {
+ super.setWidth(width);
+ if(!width.equals("") || width != null) {
+ DOM.setStyleAttribute(DOM.getFirstChild(getElement()), "width", "100%");
+ } else {
+ DOM.setStyleAttribute(DOM.getFirstChild(getElement()), "width", "");
+ }
+ }
}
public static final int FILTERINGMODE_OFF = 0;