package org.realityforge.arez.examples;

import org.realityforge.arez.ArezContext;

public final class CodeModelExample
{
  public static void main( final String[] args )
    throws Exception
  {
    final ArezContext context = new ArezContext();

    ExampleUtil.logAllErrors( context );

    final CodeModel codeModel = new Arez_CodeModel( context, "com.example", "MyType" );

    context.autorun( "Printer",
                     false,
                     () -> System.out.println( "Qualified Name: " + codeModel.getQualifiedName() ),
                     true );

    context.procedure( "Specific Qualified Name", true, () -> codeModel.setQualifiedName( "com.biz.Fred" ) );
    context.procedure( "Reset Qualified Name to default", true, () -> codeModel.setQualifiedName( null ) );
    context.procedure( "Change Local Name", true, () -> codeModel.setName( "MyType2" ) );
  }
}

@@ -75,16 +75,96 @@
 Context;
+%0Aimport org.realityforge.arez.Disposable;%0Aimport org.realityforge.arez.Observer;
 %0A%0Apublic
@@ -448,24 +448,56 @@
 MyType%22 );%0A%0A
+    final Observer observer =%0A  
     context.
@@ -541,15 +541,19 @@
     
+ 
+ 
 false,%0A
+  
     
@@ -615,16 +615,65 @@
 ame: %22 +
+%0A                                                
  codeMod
@@ -697,16 +697,18 @@
 me() ),%0A
+  
         
@@ -943,24 +943,24 @@
 ( null ) );%0A
-
     context.
@@ -1036,15 +1036,125 @@
 e2%22 ) );
+%0A%0A    observer.dispose();%0A    context.procedure( %22Dispose Model%22, true, ( (Disposable) codeModel )::dispose );
 %0A  %7D%0A%7D%0A

Add an example of dispose