|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
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)
選択された選択肢 (1 つ) を設定します。 |
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 リストのインデックスとして表される defaultChoicepublic boolean allowMultipleSelections()
choices リストで複数選択が可能かどうかを意味するブール値を取得します。
public void setSelectedIndex(int selection)
selection - choices リストのインデックスとして表される選択内容 (1 つ)getSelectedIndexes()public void setSelectedIndexes(int[] selections)
selections - choices リストのインデックスとして表される選択内容 (複数)
UnsupportedOperationException - 複数選択ができない場合。これは allowMultipleSelections の値で表されるgetSelectedIndexes()public int[] getSelectedIndexes()
choices リストのインデックスとして表されるsetSelectedIndexes(int[])
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。