すべてのパッケージ クラス階層 このパッケージ 前へ 次へ 索引
java.lang.Object | +----com.ibm.eNetwork.ECL.ECLScreenReco
ECLScreenReco クラスのオブジェクトは、固有な「認識セット」として考えてください。 オブジェクトは、画面を監視する複数の ECLPS オブジェクト、 検索する複数の画面、 および任意の ECLPS オブジェクトの中に画面を表示するときに呼び出す複数のコールバック・ポイントを持つことができます。
ユーザーはアプリケーションの開始時に ECLScreenReco オブジェクトを設定するだけでよく、 モニターしたい画面が ECLPS に現れるときに、 使用するコードが ECLScreenReco によって呼び出されます。
次は、一般的なインプリメンテーション例です。
class MyApp { ECLSession myECLSession; // My main HACL session ECLPS myECLPS; // The presentation space from the session ECLScreenReco myScreenReco; // My screen reco object ECLScreenDesc myScreenDesc; // My screen descriptor MyRecoCallback myCallback; // My GUI handler
public static void main(String argv[]) { MyApp app = new MyApp(); app.showMainGUI(); }
public MyApp() { // Set up HACL session Properties p = new Properties(); p.put(Session.SESSION_TYPE, ECLSession.SESSION_TYPE_3270_STR); p.put(Session.CODE_PAGE, ECLSession.SESSION_CODE_PAGE_DEFAULT); p.put(Session.AUTO_RECONNECT, "true"); p.put(Session.HOST, "ralvm5"); myECLSession = new ECLSession(p); myECLSession.StartCommunication(); myECLPS = myECLSession.GetPS();7*
// Set up my callback object myCallback = new MyRecoCallback();
// Save the number of fields for below ECLFieldList fl = myECLPS.GetFieldList(ALL_PLANES) fl.Refresh(ALL_PLANES); int numFields = fl.GetFieldCount();
// Set up my HACL screen description object. Say the screen // is identified by a cursor position, a key word, and the // number of fields myScreenDesc = new ECLScreenDesc(); myScreenDesc.AddCursorPos(23,1); myScreenDesc.AddString("LOGON"); myScreenDesc.AddNumFields(numFields);
// Set up HACL screen reco object, it will begin monitoring here myScreenReco = new ECLScreenReco(); myScreenReco.AddPS(myECLPS); myScreenReco.RegisterScreen(myScreenDesc, myCallback); }
public void showMainGUI() { // Show the main application GUI, this is just a simple example Frame myFrame = new Frame("Main GUI"); Dialog dlg = new Dialog(myFrame); dlg.show(); }
// ECLRecoNotify-derived inner class (the "callback" code) class MyRecoCallback extends ECLRecoNotify { public void NotifyEvent(ECLScreenDesc sd, ECLPS ps) { // GUI code here for the specific screen // Maybe fire a dialog that front ends the screen }
public void NotifyError(ECLScreenDesc sd, ECLPS ps, ECLErr e) { // Error handling }
public void NotifyStop(ECLScreenDesc sd, ECLPS ps, int Reason) { // Possible stop monitoring, not essential } }
}
public ECLScreenReco()
public synchronized void RegisterScreen(ECLScreenDesc sd, ECLRecoNotify notify)
public synchronized void UnregisterScreen(ECLScreenDesc sd)
public synchronized void AddPS(ECLPS ps)
public synchronized void RemovePS(ECLPS ps)
public static boolean IsMatch(ECLPS ps, ECLScreenDesc sd) throws ECLErr
すべてのパッケージ クラス階層 このパッケージ 前へ 次へ 索引