function FontFamilySelector() 
{
    /**
     * implementation of @{link EventHandler} interface
     */
    this.onEvent = function(evt, src, data) {
	if( evt == EventManager.EVENT_HEADING_SELECTED ) {
	    this.fHeadingView = src;
	    this.update();
	}
	else if( evt == EventManager.EVENT_MENU_CLOSED )
	    this.setSelected(false);

    }

    /**
     * called when a certain font is selected (used in testing also)
     * @private
     */
    this.onFont = function(font) {
	if( this.fHeadingView ) {
	    this.fHeadingView.setFont(font);
	    this.update();
	}
    }

    /**
     * implementation of @{link ActionHandler} interface
     */
    this.doAction = function(src, actionID) {
	if( src == this ) {
	    var obj = src.getContent();
	    var x = LookAndFeel.findPosX(obj);
	    var y = LookAndFeel.findPosY(obj) + obj.offsetHeight;
	    if( !this.fFontMenuInitialized ) {
		this.fFontMenuInitialized = true;
		this.fFontMenu.init(this);
	    }
	    this.fFontMenu.show(x,y);
	}
	else {
	    this.onFont(actionID);
	}
    }

    /**
     * override of base-class method to provide real content
     */
    this.provideContentO = function() {
	var div = document.createElement("div");
	div.style.fontSize   = "85%";	// need to to this to match toolbar font
	div.style.fontWeight = "bold";	// need to to this to match toolbar font
	div.style.width      = "100%";
	if( !Utils.isIE() )		// IE doesnt support table
	    div.style.display  = "table";	// very important for firefox so that arrow
					// div below has a chance to occupy same
					// height as others (and draw at the bottom)
	//div.style.width    = "6em";


	var div2 = document.createElement("div");
	div2.style.cssFloat = "left";
	div2.style.display  = "inline";
	div2.style.height = "100%";
	//div2.style.width  = "6em";
	this.fLabelView = document.createTextNode(this._getFontName());
	div2.appendChild(this.fLabelView);
	div.appendChild(div2);
	return div;
    }

    this.provideContent = function() {
	var table = document.createElement("table");
	var tr = table.insertRow(0);

	var div = document.createElement("div");
	this.fLabelView = document.createTextNode(this._getFontName());
	div.style.height = "100%";
	div.style.fontSize = "85%";
	div.style.fontWeight = "bold";
	div.appendChild(this.fLabelView);
	Utils.addTableCell(tr, div, 1);

	var arrow = document.createElement("div");
	arrow.style.width = "12px";
	arrow.style.height = "100%";
	arrow.style.background = LookAndFeel.url("but_arrow.png") + " center right no-repeat";	
	arrow.style.cssFloat = "right";
	arrow.style.display  = "inline";
	Utils.addTableCell(tr, arrow, 1);
	return table;
    }

    /**
     * internal method to get stringized form of the font family
     * @return get stringized form of font family
     * @type String
     * @private
     */
    this._getFontName = function() {
	var sz = "Default";
	if(this.fHeadingView) {
	     sz = this.fHeadingView.getModel().fFont;
	     if( sz == "" ) sz = "Default";
	}
	return sz;
    }

    /**
     * internal method to update display
     * @private
     */
    this.update = function() {
	this.fLabelView.nodeValue = this._getFontName();
    }

    /**
     * the font menu which is popped-up when the selector is selected
     * @type FontMenu
     * @private
     */
    this.fFontMenu = new FontMenu();
    this.fFontMenu.initMenu();

    /**
     * is the font menu initialized w.r.t fonts?
     */
    this.fFontMenuInitialized = false;

    this.initButton(this, null);
    EventManager.addListener(EventManager.EVENT_HEADING_SELECTED, this);
    EventManager.addListener(EventManager.EVENT_FONT_ADDED, this);

    /**
     * current heading view being modified
     * @type HeadingView
     * @private
     */
    this.fHeadingView = null;
}
/**
 * @class
 * text font-family selector, which is part of the heading tool bar. It also
 * implements the @{link EventListener} and @{link ActionHandler} interfaces
 */
@class
text font-family selector, which is part of the heading tool bar. It also
implements the @{link EventListener} and @{link ActionHandler} interfaces
@class text font - family selector which is part of the heading tool bar . It also implements the @ { link EventListener } and @ { link ActionHandler } interfaces
function FontFamilySelector() 
{
    this.onEvent = function(evt, src, data) {
	if( evt == EventManager.EVENT_HEADING_SELECTED ) {
	    this.fHeadingView = src;
	    this.update();
	}
	else if( evt == EventManager.EVENT_MENU_CLOSED )
	    this.setSelected(false);
    }
    this.onFont = function(font) {
	if( this.fHeadingView ) {
	    this.fHeadingView.setFont(font);
	    this.update();
	}
    }
    this.doAction = function(src, actionID) {
	if( src == this ) {
	    var obj = src.getContent();
	    var x = LookAndFeel.findPosX(obj);
	    var y = LookAndFeel.findPosY(obj) + obj.offsetHeight;
	    if( !this.fFontMenuInitialized ) {
		this.fFontMenuInitialized = true;
		this.fFontMenu.init(this);
	    }
	    this.fFontMenu.show(x,y);
	}
	else {
	    this.onFont(actionID);
	}
    }
    this.provideContentO = function() {
	var div = document.createElement("div");
	div.style.fontSize   = "85%";	
	div.style.fontWeight = "bold";	
	div.style.width      = "100%";
	if( !Utils.isIE() )		
	    div.style.display  = "table";	
	var div2 = document.createElement("div");
	div2.style.cssFloat = "left";
	div2.style.display  = "inline";
	div2.style.height = "100%";
	this.fLabelView = document.createTextNode(this._getFontName());
	div2.appendChild(this.fLabelView);
	div.appendChild(div2);
	return div;
    }
    this.provideContent = function() {
	var table = document.createElement("table");
	var tr = table.insertRow(0);
	var div = document.createElement("div");
	this.fLabelView = document.createTextNode(this._getFontName());
	div.style.height = "100%";
	div.style.fontSize = "85%";
	div.style.fontWeight = "bold";
	div.appendChild(this.fLabelView);
	Utils.addTableCell(tr, div, 1);
	var arrow = document.createElement("div");
	arrow.style.width = "12px";
	arrow.style.height = "100%";
	arrow.style.background = LookAndFeel.url("but_arrow.png") + " center right no-repeat";	
	arrow.style.cssFloat = "right";
	arrow.style.display  = "inline";
	Utils.addTableCell(tr, arrow, 1);
	return table;
    }
    this._getFontName = function() {
	var sz = "Default";
	if(this.fHeadingView) {
	     sz = this.fHeadingView.getModel().fFont;
	     if( sz == "" ) sz = "Default";
	}
	return sz;
    }
    this.update = function() {
	this.fLabelView.nodeValue = this._getFontName();
    }
    this.fFontMenu = new FontMenu();
    this.fFontMenu.initMenu();
    this.fFontMenuInitialized = false;
    this.initButton(this, null);
    EventManager.addListener(EventManager.EVENT_HEADING_SELECTED, this);
    EventManager.addListener(EventManager.EVENT_FONT_ADDED, this);
    this.fHeadingView = null;
}
function FontFamilySelector ( ) { this . onEvent = function ( evt , src , data ) { if ( evt == EventManager . EVENT_HEADING_SELECTED ) { this . fHeadingView = src ; this . update ( ) ; } else if ( evt == EventManager . EVENT_MENU_CLOSED ) this . setSelected ( false ) ; } this . onFont = function ( font ) { if ( this . fHeadingView ) { this . fHeadingView . setFont ( font ) ; this . update ( ) ; } } this . doAction = function ( src , actionID ) { if ( src == this ) { var obj = src . getContent ( ) ; var x = LookAndFeel . findPosX ( obj ) ; var y = LookAndFeel . findPosY ( obj ) + obj . offsetHeight ; if ( ! this . fFontMenuInitialized ) { this . fFontMenuInitialized = true ; this . fFontMenu . init ( this ) ; } this . fFontMenu . show ( x , y ) ; } else { this . onFont ( actionID ) ; } } this . provideContentO = function ( ) { var div = document . createElement ( "div" ) ; div . style . fontSize = "85%" ; div . style . fontWeight = "bold" ; div . style . width = "100%" ; if ( ! Utils . isIE ( ) ) div . style . display = "table" ; var div2 = document . createElement ( "div" ) ; div2 . style . cssFloat = "left" ; div2 . style . display = "inline" ; div2 . style . height = "100%" ; this . fLabelView = document . createTextNode ( this . _getFontName ( ) ) ; div2 . appendChild ( this . fLabelView ) ; div . appendChild ( div2 ) ; return div ; } this . provideContent = function ( ) { var table = document . createElement ( "table" ) ; var tr = table . insertRow ( 0 ) ; var div = document . createElement ( "div" ) ; this . fLabelView = document . createTextNode ( this . _getFontName ( ) ) ; div . style . height = "100%" ; div . style . fontSize = "85%" ; div . style . fontWeight = "bold" ; div . appendChild ( this . fLabelView ) ; Utils . addTableCell ( tr , div , 1 ) ; var arrow = document . createElement ( "div" ) ; arrow . style . width = "12px" ; arrow . style . height = "100%" ; arrow . style . background = LookAndFeel . url ( "but_arrow.png" ) + " center right no-repeat" ; arrow . style . cssFloat = "right" ; arrow . style . display = "inline" ; Utils . addTableCell ( tr , arrow , 1 ) ; return table ; } this . _getFontName = function ( ) { var sz = "Default" ; if ( this . fHeadingView ) { sz = this . fHeadingView . getModel ( ) . fFont ; if ( sz == "" ) sz = "Default" ; } return sz ; } this . update = function ( ) { this . fLabelView . nodeValue = this . _getFontName ( ) ; } this . fFontMenu = new FontMenu ( ) ; this . fFontMenu . initMenu ( ) ; this . fFontMenuInitialized = false ; this . initButton ( this , null ) ; EventManager . addListener ( EventManager . EVENT_HEADING_SELECTED , this ) ; EventManager . addListener ( EventManager . EVENT_FONT_ADDED , this ) ; this . fHeadingView = null ; }
@class
 text font-family selector, which is part of the heading tool bar.
@class text font - family selector which is part of the heading tool bar .
/**
     * implementation of @{link EventHandler} interface
     */ /**
     * called when a certain font is selected (used in testing also)
     * @private
     */ /**
     * implementation of @{link ActionHandler} interface
     */ /**
     * override of base-class method to provide real content
     */ // need to to this to match toolbar font
 // need to to this to match toolbar font
 // IE doesnt support table
 // very important for firefox so that arrow
 // div below has a chance to occupy same
 // height as others (and draw at the bottom)
 //div.style.width    = "6em";
 //div2.style.width  = "6em";
 /**
     * internal method to get stringized form of the font family
     * @return get stringized form of font family
     * @type String
     * @private
     */ /**
     * internal method to update display
     * @private
     */ /**
     * the font menu which is popped-up when the selector is selected
     * @type FontMenu
     * @private
     */ /**
     * is the font menu initialized w.r.t fonts?
     */ /**
     * current heading view being modified
     * @type HeadingView
     * @private
     */