code: function(ctx, flag, callOpts) {
  				var targetNode;
  
  				flag = flag !== false;
  
  				// this.debug("treeSetFocus(" + flag + "), callOpts: ", callOpts, this.hasFocus());
  				// this.debug("    focusNode: " + this.focusNode);
  				// this.debug("    activeNode: " + this.activeNode);
  				if (flag !== this.hasFocus()) {
  					this._hasFocus = flag;
  					if (!flag && this.focusNode) {
  						// Node also looses focus if widget blurs
  						this.focusNode.setFocus(false);
  					} else if (flag && (!callOpts || !callOpts.calledByNode)) {
  						$(this.$container).focus();
  					}
  					this.$container.toggleClass("fancytree-treefocus", flag);
  					this._triggerTreeEvent(flag ? "focusTree" : "blurTree");
  					if (flag && !this.activeNode) {
  						// #712: Use last mousedowned node ('click' event fires after focusin)
  						targetNode =
  							this._lastMousedownNode || this.getFirstChild();
  						targetNode && targetNode.setFocus();
  					}
  				}
  			}
docs: Widget got focus.
  @param {EventData} ctx
  @param {boolean} [flag=true]