home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / vj / VJ98 / VJProjs / webpages / codehtm / CodeHtm.jav < prev    next >
Encoding:
Text File  |  1998-07-06  |  1.7 KB  |  65 lines

  1. import com.ms.wfc.html.*;
  2. import com.ms.wfc.core.*;
  3. import com.ms.wfc.ui.*;
  4.  
  5. public class Class1 extends DhDocument 
  6. {
  7.     DhText createdText;
  8.     DhText boundText;
  9.     
  10.     public Class1() 
  11.     {
  12.         // Required for Visual J++ Form Designer support
  13.         initForm();        
  14.  
  15.         // TODO: Add any constructor code after initForm call
  16.     }
  17.  
  18.     /**
  19.      * Class1 overrides dispose so it can clean up the
  20.      * component list.
  21.      */
  22.     public void dispose() 
  23.     {
  24.         super.dispose();
  25.     }
  26.  
  27.     /**
  28.      * Add all your initialization code here. The code here can add elements,
  29.      * set bindings to existing elements, set new properties and event handlers
  30.      * on elements. The underlying HTML document is not available at this stage,
  31.      * so any calls that rely on the document being present should be added to
  32.      * the onDocumentLoad() function below (client-only).
  33.      */
  34.     private void initForm() 
  35.     {
  36.         createdText = new DhText();
  37.         createdText.setText("Created Text");
  38.                 
  39.         boundText = new DhText();
  40.         boundText.setID("bindText");
  41.         boundText.setBackColor(Color.LIGHTGRAY);
  42.  
  43.         /**
  44.          * setBoundElements() will take a list of elements that already are present
  45.          * in the HTML document, and binds them to the DhElement list.
  46.          */
  47.         setBoundElements(new DhElement[] {boundText});
  48.  
  49.         /**
  50.          * setNewElements() takes a list of DhElements and adds them to the HTML document.
  51.          */
  52.         setNewElements(new DhElement[] {createdText});
  53.     }
  54.     
  55.     /**
  56.      * Client-side only.
  57.      * 
  58.      * Here, the underlying HTML document is available for inspection. Add any code 
  59.      * that wants to get properties of elements or inspect the document in any other way.
  60.      */
  61.     protected void onDocumentLoad(Object sender, Event e) 
  62.     {
  63.     }
  64. }
  65.