Bug 130495 Get rid of SessionHandleAdapter
Now, we use SessionHandleAdapter to keep current active report deisng. That's a bad practive for editor swith and rebuild will cuase lots of problmes. Need find way to replace it.
UI/org.eclipse.birt.report.designer.core/src/org/eclipse/birt/report/designer/core/model/SessionHandleAdapter.java
import org.eclipse.birt.report.model.api.core.DisposeEvent;
import org.eclipse.birt.report.model.api.core.IDisposeListener;
import org.eclipse.birt.report.model.api.metadata.IMetaDataDictionary;
/**
 * Adapter class to adpat model handle. This adapter provides convenience
 * methods to GUI requirement SessionHandleAdapter responds to model
 * SessionHandle
 * 
 */
public class SessionHandleAdapter
{
	public static final int UNKNOWFILE = -1;
	public static int DESIGNEFILE = 0;
	public static int LIBRARYFILE = 1;
	public static int TEMPLATEFILE = 2;
	private int type = DESIGNEFILE;
	IDisposeListener disposeLitener = new IDisposeListener( ) {
		public void moduleDisposed( ModuleHandle targetElement, DisposeEvent ev )
		{
			ReportMediator media = (ReportMediator) mediatorMap.get( targetElement );
			if ( media != null )
			{
				media.dispose( );
			}
			mediatorMap.remove( targetElement );
			targetElement.removeDisposeListener( this );
		}
	};
	
	private Map mediatorMap = new WeakHashMap( );