@ClientWidget(VFilterSelect.class)\r
public class ComboBox extends Select {\r
\r
- private String inputPrompt = null;\r
+ private String inputPrompt = null;\r
\r
- public ComboBox() {\r
- setMultiSelect(false);\r
- setNewItemsAllowed(false);\r
- }\r
+ public ComboBox() {\r
+ setMultiSelect(false);\r
+ setNewItemsAllowed(false);\r
+ }\r
\r
- public ComboBox(String caption, Collection options) {\r
- super(caption, options);\r
- setMultiSelect(false);\r
- setNewItemsAllowed(false);\r
- }\r
+ public ComboBox(String caption, Collection options) {\r
+ super(caption, options);\r
+ setMultiSelect(false);\r
+ setNewItemsAllowed(false);\r
+ }\r
\r
- public ComboBox(String caption, Container dataSource) {\r
- super(caption, dataSource);\r
- setMultiSelect(false);\r
- setNewItemsAllowed(false);\r
- }\r
+ public ComboBox(String caption, Container dataSource) {\r
+ super(caption, dataSource);\r
+ setMultiSelect(false);\r
+ setNewItemsAllowed(false);\r
+ }\r
\r
- public ComboBox(String caption) {\r
- super(caption);\r
- setMultiSelect(false);\r
- setNewItemsAllowed(false);\r
- }\r
+ public ComboBox(String caption) {\r
+ super(caption);\r
+ setMultiSelect(false);\r
+ setNewItemsAllowed(false);\r
+ }\r
\r
- @Override\r
- public void setMultiSelect(boolean multiSelect) {\r
- if (multiSelect && !isMultiSelect()) {\r
- throw new UnsupportedOperationException("Multiselect not supported");\r
- }\r
- super.setMultiSelect(multiSelect);\r
- }\r
+ @Override\r
+ public void setMultiSelect(boolean multiSelect) {\r
+ if (multiSelect && !isMultiSelect()) {\r
+ throw new UnsupportedOperationException("Multiselect not supported");\r
+ }\r
+ super.setMultiSelect(multiSelect);\r
+ }\r
\r
- /**\r
- * Gets the current input prompt.\r
- * \r
- * @see #setInputPrompt(String)\r
- * @return the current input prompt, or null if not enabled\r
- */\r
- public String getInputPrompt() {\r
- return inputPrompt;\r
- }\r
+ /**\r
+ * Gets the current input prompt.\r
+ * \r
+ * @see #setInputPrompt(String)\r
+ * @return the current input prompt, or null if not enabled\r
+ */\r
+ public String getInputPrompt() {\r
+ return inputPrompt;\r
+ }\r
\r
- /**\r
- * Sets the input prompt - a textual prompt that is displayed when the\r
- * select would otherwise be empty, to prompt the user for input.\r
- * \r
- * @param inputPrompt\r
- * the desired input prompt, or null to disable\r
- */\r
- public void setInputPrompt(String inputPrompt) {\r
- this.inputPrompt = inputPrompt;\r
- }\r
+ /**\r
+ * Sets the input prompt - a textual prompt that is displayed when the\r
+ * select would otherwise be empty, to prompt the user for input.\r
+ * \r
+ * @param inputPrompt\r
+ * the desired input prompt, or null to disable\r
+ */\r
+ public void setInputPrompt(String inputPrompt) {\r
+ this.inputPrompt = inputPrompt;\r
+ requestRepaint();\r
+ }\r
\r
- @Override\r
- public void paintContent(PaintTarget target) throws PaintException {\r
- if (inputPrompt != null) {\r
- target.addAttribute("prompt", inputPrompt);\r
- }\r
- super.paintContent(target);\r
- }\r
+ @Override\r
+ public void paintContent(PaintTarget target) throws PaintException {\r
+ if (inputPrompt != null) {\r
+ target.addAttribute("prompt", inputPrompt);\r
+ }\r
+ super.paintContent(target);\r
+ }\r
\r
}\r