| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.security.auth.callback.ChoiceCallback
public class ChoiceCallback
 底层安全服务实例化一个 ChoiceCallback ,并将它传递给 CallbackHandler 的 handle 方法,以显示选项列表并获取选中的选项。
CallbackHandler, 
序列化表格| 构造方法摘要 | |
|---|---|
| ChoiceCallback(String prompt,
               String[] choices,
               int defaultChoice,
               boolean multipleSelectionsAllowed)构造一个 ChoiceCallback,带有提示、选项列表、默认选项和指定选项列表是否允许进行多重选择的布尔值。 | |
| 方法摘要 | |
|---|---|
|  boolean | allowMultipleSelections()获取布尔值,该布尔值确定是否允许从该 choices列表进行多重选择。 | 
|  String[] | getChoices()获取选项列表。 | 
|  int | getDefaultChoice()获取 defaultChoice。 | 
|  String | getPrompt()获取提示。 | 
|  int[] | getSelectedIndexes()获取选中的选项。 | 
|  void | setSelectedIndex(int selection)设置选中的选项。 | 
|  void | setSelectedIndexes(int[] selections)设置选中的选项。 | 
| 从类 java.lang.Object 继承的方法 | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| 构造方法详细信息 | 
|---|
public ChoiceCallback(String prompt,
                      String[] choices,
                      int defaultChoice,
                      boolean multipleSelectionsAllowed)
ChoiceCallback,带有提示、选项列表、默认选项和指定选项列表是否允许进行多重选择的布尔值。
 
prompt - 用于描述选项列表的提示。 choices - 选项列表。 defaultChoice - 该选项用作显示选项列表时的默认选项。此值表示为 choices 数组中的索引。 multipleSelectionsAllowed - 指定是否可以从选项列表进行多重选择的布尔值。
IllegalArgumentException - 如果 prompt 为 null,如果 prompt 的长度为 0,如果 choices 为 null,如果 choices 的长度为 0,如果 choices 中的任何元素为 null,如果 choices 中的任何元素的长度为 0,或者 defaultChoice 不在 choices 的数组边界内。| 方法详细信息 | 
|---|
public String getPrompt()
public String[] getChoices()
public int getDefaultChoice()
choices 列表中的索引。public boolean allowMultipleSelections()
choices 列表进行多重选择。
 
public void setSelectedIndex(int selection)
selection - 表示为 choices 列表中的索引的选择。getSelectedIndexes()public void setSelectedIndexes(int[] selections)
selections - 表示为 choices 列表中的索引的选择。
UnsupportedOperationException - 如果不允许进行多重选择(由 allowMultipleSelections 确定),则抛出该异常。getSelectedIndexes()public int[] getSelectedIndexes()
choices 列表中的索引。setSelectedIndexes(int[])| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。