VWAttachmentPanel の操作
ここでは、VWAttachmentPanel Bean を操作して添付ファイルにアクセスする方法の例を示します。これらの添付ファイルは、Java™ ステップ・プロセッサーまたは Launch ステップ・プロセッサーによってオブジェクト・ストアに格納されます。
この VWAttachmentPanel をインスタンス化するメソッドは、以下のユーザーに役立ちます。
- IDE を使用していない開発者
- VWTabbedPane コントロールを使用せずに添付ファイルを取得する方法に興味のあるすべてのユーザー
注: 次のような状況では、VWAttachmentPanel コンポーネントをインスタンス化するためのコードが自動的に追加されます。
- コンポーネントをフォームにドラッグするとき
- IDE を使用しており、プロジェクトのクラスパスに vwpanel.jar を追加済みである場合
- 次の情報を渡して適切に Bean を初期化します。
- VWStepElement オブジェクト
- Frame オブジェクト (包含する側の親フレーム)
- 有効な VWSession オブジェクト
次の例では、クラス定義の先頭近くで以下の 3 つの変数を宣言し、初期化することを仮定しています。
VWStepElement vwStepElement = null; Frame parentFrame = null; VWSession vwSession = null;
- 次のように、VWStepElement フィールド・タイプをテストした後で、VWAttachmentPanel Bean をインスタンス化します。
JComponent newJComponent = null; if (vwStepElement.getParameters(VWFieldType.FIELD_TYPE_ATTACHMENT, VWStepElement.FIELD_USER_DEFINED) != null) newJComponent = (JComponent)Beans.instantiate(getClass().getClassLoader(), "filenet.vw.toolkit.runtime.step.beans.VWAttachmentPanel"); if (newJComponent != null) ¥¥While it is not shown here, you should include code to add the JComponent to the ¥¥containing VWPanel to expose the attachment list to the end user. if (newJComponent instanceof IVWStepProcessorComponent) ((IVWStepProcessorComponent)newJComponent).init(vwStepElement, parentFrame, vwSession);