Parse {@link _cWidget#resources}
@param {(_cRawDirective|_cRawTag)} raw_directive
@param {_cWidget} widget_config
330931
function(raw_directive, widget_config) {

		if (Lava.schema.DEBUG && (!raw_directive.attributes || !raw_directive.attributes['locale'])) Lava.t("Malformed resources definition, missing locale");

		if (!widget_config.resources) {
			widget_config.resources = {}
		}

		if (Lava.schema.DEBUG && (raw_directive.attributes['locale'] in widget_config.resources))
			Lava.t("Locale is already defined: " + raw_directive.attributes['locale']);

		widget_config.resources[raw_directive.attributes['locale']] = this._parseResources(raw_directive, this._current_widget_title);

	}
210448
function (res, args) {
            var tplcfg = this._tplcfg;
            if (!tplcfg) {
                // the template may be ready after the widget has been disposed
                // do nothing in this case
                // except disposing the module which has just been created
                if (args.autoDispose) {
                    res.moduleCtrlPrivate.$dispose();
                }
                return;
            }

            var tplDiv = this._subTplDiv; // may be null at this time

            tplcfg.tplDiv = tplDiv;

            tplcfg.data = this._cfg.data;

            // if a module controller was created, inject it in template initialization
            if (res.moduleCtrl) {
                tplcfg.moduleCtrl = res.moduleCtrl;
            } else {
                tplcfg.context = this._context;
            }
            if (args.autoDispose) {
                if (tplcfg.toDispose == null) {
                    tplcfg.toDispose = [res.moduleCtrlPrivate];
                } else {
                    tplcfg.toDispose.push(res.moduleCtrlPrivate);
                }
            }
            /*
             * var tplCtxt = new aria.templates.TemplateCtxt(); this.subTplCtxt = tplCtxt;
             */
            var tplCtxt = this.subTplCtxt;
            tplCtxt.parent = this._context;

            res = tplCtxt.initTemplate(tplcfg);
            this._initCtxDone = true;

            if (res) {
                tplCtxt.dataReady(); // data successfully loaded: signal to template through TemplateContext
                // check that tplCtxt was not disposed
                if (tplDiv && tplCtxt._cfg) {
                    // Load the CSS dependencies, the style should be added before the html
                    tplDiv.className = tplDiv.className + " " + tplCtxt.getCSSClassNames(true);
                    tplCtxt.$onOnce({
                        "Ready" : this.__innerTplReadyCb,
                        scope : this
                    });
                    tplCtxt.$refresh();
                }
                // don't clean this object, as the template context will do it. Just break reference
                this.tplcfg = null;

            } else {
                tplCtxt.$dispose();
                this.subTplCtxt = null;
            }

            tplDiv = null;
        }
1115714
function (cfg, context, lineNumber) {
        this.$BindableWidget.constructor.apply(this, arguments);

        this._cfgOk = ariaCoreJsonValidator.validateCfg(this.WIDGET_CFG, cfg);

        if (!this._cfgOk) {
            return;
        }

        this._registerBindings();

        /**
         * Id generated for the button DOM element of the slider.
         * @type String
         * @protected
         */
        this._domId = cfg.id ? context.$getId(cfg.id) : this._createDynamicId();

    }
36639
function(config, widget, parent_view, template, properties) {

		var name,
			argument,
			constructor;

		this.guid = Lava.guid++;
		if (Lava.schema.DEBUG && config.id && !Lava.isValidId(config.id)) Lava.t();
		if ('id' in config) {
			this.id = config.id;
		}
		if ('label' in config) {
			this.label = config.label;
		}

		Lava.view_manager.registerView(this);

		this._config = config;
		this._widget = widget;
		this._template = template;

		if (parent_view) {

			this._parent_view = parent_view;
			this._parent_with_container = parent_view.getContainer() ? parent_view : parent_view.getParentWithContainer();
			this.depth = parent_view.depth + 1;

		}

		this._initMembers(properties);

		for (name in config.assigns) {

			if (config.assigns[name].once) {

				argument = new Lava.scope.Argument(config.assigns[name], this, this._widget);
				this.set(name, argument.getValue());
				argument.destroy();

			} else {

				if (name in this._property_bindings_by_property) Lava.t("Error initializing assign: property binding already created");

				this._property_bindings_by_property[name] = new Lava.scope.PropertyBinding(this, name, config.assigns[name]);

			}

		}

		if ('container' in config) {

			constructor = Lava.ClassManager.getConstructor(config.container['type'], 'Lava.view.container');
			this._container = new constructor(this, config.container, widget);

		}

		this._postInit();

		if ('roles' in  config) Lava.view_manager.dispatchRoles(this, config.roles);

	}
817939
function(raw_tag) {

		if (Lava.schema.DEBUG && (!raw_tag.content || raw_tag.content.length != 1 || raw_tag.content[0] == '')) Lava.t("Malformed resources options tag");

		return {
			type: 'options',
			value: Lava.parseOptions(raw_tag.content[0])
		};

	}
162036
private void parseResources(Element element, BeanDefinitionBuilder builder,
                                ManagedList<AbstractBeanDefinition> resourceList) {
        NodeList resources = element.getChildNodes();

        for (int i = 0; i < resources.getLength(); i++) {
            Node node = resources.item(i);

            if (!(node instanceof Element)) {
                continue;
            }

            Element resource = (Element) resources.item(i);
            Class<? extends IPluginResource> resourceClass = null;

            switch (getResourceType(getNodeName(resource))) {
                case button:
                    resourceClass = PluginResourceButton.class;
                    break;
                
                case help:
                    resourceClass = PluginResourceHelp.class;
                    break;
                
                case menu:
                    resourceClass = PluginResourceMenu.class;
                    break;
                
                case property:
                    resourceClass = PluginResourcePropertyGroup.class;
                    break;
                
                case css:
                    resourceClass = PluginResourceCSS.class;
                    break;
                
                case bean:
                    resourceClass = PluginResourceBean.class;
                    break;
                
                case command:
                    resourceClass = PluginResourceCommand.class;
                    break;
                
                case action:
                    resourceClass = PluginResourceAction.class;
                    break;
            }

            if (resourceClass != null) {
                BeanDefinitionBuilder resourceBuilder = BeanDefinitionBuilder.genericBeanDefinition(resourceClass);
                addProperties(resource, resourceBuilder);
                resourceList.add(resourceBuilder.getBeanDefinition());
            }
        }
    }
1336627
function(view_config, raw_tag) {

		var x = raw_tag.x;

		if (x) {

			if (Lava.schema.DEBUG) this._assertControlAttributesValid(x);
			if ('options' in x) {

				if (typeof(x.options) != 'object') Lava.t("Malformed x:options");
				view_config.options = x.options;

			}
			if ('label' in x) this.setViewConfigLabel(view_config, x.label);
			if ('roles' in x) view_config.roles = this.parseTargets(x.roles);

		}

		if (('attributes' in raw_tag) && ('id' in raw_tag.attributes)) this.setViewConfigId(view_config, raw_tag.attributes.id);

	}
598608
function RawNode(raw, config, app) {
  utils.define(this, 'isRawNode', true);
  util.run(config, 'rawNode', raw);
  this.files = [];
  var paths = {};

  raw.options = utils.extend({}, config.options, raw.options);
  var opts = resolvePaths(raw.options);
  var filter = filterFiles(opts);

  var srcFiles = utils.arrayify(raw.src);
  if (opts.glob !== false && utils.hasGlob(raw.src)) {
    srcFiles = utils.glob.sync(raw.src, opts);
  }

  srcFiles = srcFiles.filter(filter);

  if (config.options.mapDest) {
    var len = srcFiles.length, i = -1;
    while (++i < len) {
      var node = new FilesNode(srcFiles[i], raw, config);
      app.emit('files', 'filesNode', node);
      app.emit('filesNode', node);
      var dest = node.dest;

      if (!node.src && !node.path) {
        continue;
      }

      var src = resolveArray(node.src, opts);
      if (paths[dest]) {
        paths[dest].src = paths[dest].src.concat(src);
      } else {
        node.src = utils.arrayify(src);
        this.files.push(node);
        paths[dest] = node;
      }
    }

    if (!this.files.length) {
      node = raw;
      raw.src = [];
      this.files.push(raw);
    }

  } else {
    createNode(srcFiles, raw, this.files, config);
  }
}
139466
function(raw_tag, widget_config) {

		if ('sugar' in widget_config) Lava.t("Sugar is already defined");
		if (Lava.schema.DEBUG && raw_tag.content.length != 1) Lava.t("Malformed option: " + raw_tag.attributes.name);
		widget_config.sugar = Lava.parseOptions(raw_tag.content[0]);

	}
528104
function(raw_directive) {

		if (Lava.schema.DEBUG && !raw_directive.content) Lava.t("empty attach_directives");

		var blocks = Lava.parsers.Common.asBlocks(raw_directive.content),
			sugar = blocks[0],
			directives = blocks.slice(1),
			i,
			count;

		if (Lava.schema.DEBUG) {
			if (sugar.type != 'tag' || sugar.content || directives.length == 0) Lava.t("Malformed attach_directives");
			for (i = 0, count = directives.length; i < count; i++) {
				if (directives[i].type != 'directive') Lava.t("Malformed attach_directives");
			}
		}

		sugar.content = directives;
		return Lava.parsers.Common.compileAsView([sugar]);

	}
54819
function (includeWidgetCSS) {
        // __textLoaded contains a copy of what is inside the DOM
        var cm = aria.templates.CSSMgr, all = cm.__textLoaded;
        var selectors = [];
        for (var path in all) {
            if (all.hasOwnProperty(path)) {
                if (includeWidgetCSS !== true && cm.__styleTagAssociation[path] === "wgt") {
                    continue;
                }
                selectors = selectors.concat(extractSelectors(all[path].text, path));
            }
        }

        return selectors;
    }
1212678
function WidgetModel(Class, overrides) {
        var defaults = {
          title: 'Widget',
          name: Class.name,
          attrs: Class.attrs,
          dataAttrName: Class.dataAttrName,
          dataModelType: Class.dataModelType,
          dataModelArgs: Class.dataModelArgs, // used in data model constructor, not serialized
          //AW Need deep copy of options to support widget options editing
          dataModelOptions: Class.dataModelOptions,
          settingsModalOptions: Class.settingsModalOptions,
          onSettingsClose: Class.onSettingsClose,
          onSettingsDismiss: Class.onSettingsDismiss,
          style: Class.style
        };
        overrides = overrides || {};
        angular.extend(this, angular.copy(defaults), overrides);
        this.style = this.style || { width: '33%' };
        this.setWidth(this.style.width);

        if (Class.templateUrl) {
          this.templateUrl = Class.templateUrl;
        } else if (Class.template) {
          this.template = Class.template;
        } else {
          var directive = Class.directive || Class.name;
          this.directive = directive;
        }
      }
414818
function(raw_tag, widget_config) {

		if (Lava.schema.DEBUG && (!raw_tag.content || !raw_tag.content.length)) Lava.t('default_events: no content.');
		if (Lava.schema.DEBUG && ('default_events' in widget_config)) Lava.t('default_events: property already defined');

		var events = Lava.parseOptions(raw_tag.content[0]),
			i = 0,
			count;

		if (Lava.schema.DEBUG) {
			if (!Array.isArray(events)) Lava.t('default_events: array expected');
			for (count = events.length; i < count; i++) {
				if (typeof(events[i]) != 'string') Lava.t('default_events: expected an array of strings');
			}
		}

		widget_config.default_events = Lava.excludeDefaultEvents(events);

	}
688476
function(_path){
        var str = "";
        var x, y;
        var path= $options.snippetsName;

        if(!path){
            console.log("[Error] please input widget or page name!");
            return false;
        }
        

        for(x in $options.fileType){
            var files = $fs.readFileSync( $path.join(__dirname, "view/widget_tpl." + $options.fileType[x]), "utf8");

            if($options.fileType[x] == "html" || $options.fileType[x] == "css"){
                files = snippets.fn.extTpl(files, $options.snippetsName);
            }else if($options.fileType[x] == "js"){
                var fileName = $options.snippetsName.split("-");
                for(y in fileName){
                    if(y == 0){
                        continue;
                    }else{
                        fileName[y] = snippets.fn.firstUpper(fileName[y]);
                    }
                };
                fileName = fileName.join("");
                files = snippets.fn.extTpl(files, fileName);
            }else{
                return;
            }

            snippets.fn.writeFile(path, $options.fileType[x], files);
        };

        console.log("[Success] "+path+" is builded success!");
    }
133861
function(raw_directive, view_config) {

		if (Lava.schema.DEBUG && view_config.type == 'widget') Lava.t("Wrong usage of x:refresher directive. May be applied only to views.");
		if (Lava.schema.DEBUG && ('refresher' in view_config)) Lava.t("Refresher is already defined");
		if (Lava.schema.DEBUG && (!raw_directive.content || raw_directive.content.length != 1)) Lava.t("Malformed refresher config: no content");
		view_config.refresher = Lava.parseOptions(raw_directive.content[0]);

	}
429981
function(raw_directive, widget_config) {

		if (Lava.schema.DEBUG && widget_config.type != 'widget') Lava.t("property_string directive requires a widget");

		this._storeDirectiveContent(widget_config, raw_directive, 'properties');

	}
1326513
function parse(elementOrHtml, config) {
    wysihtml5.lang.object(currentRules).merge(defaultRules).merge(config.rules).get();

    var context       = config.context || elementOrHtml.ownerDocument || document,
        fragment      = context.createDocumentFragment(),
        isString      = typeof(elementOrHtml) === "string",
        clearInternals = false,
        element,
        newNode,
        firstChild;

    if (config.clearInternals === true) {
      clearInternals = true;
    }

    if (isString) {
      element = wysihtml5.dom.getAsDom(elementOrHtml, context);
    } else {
      element = elementOrHtml;
    }

    if (currentRules.selectors) {
      _applySelectorRules(element, currentRules.selectors);
    }

    while (element.firstChild) {
      firstChild = element.firstChild;
      newNode = _convert(firstChild, config.cleanUp, clearInternals, config.uneditableClass);
      if (newNode) {
        fragment.appendChild(newNode);
      }
      if (firstChild !== newNode) {
        element.removeChild(firstChild);
      }
    }

    if (config.unjoinNbsps) {
      // replace joined non-breakable spaces with unjoined
      var txtnodes = wysihtml5.dom.getTextNodes(fragment);
      for (var n = txtnodes.length; n--;) {
        txtnodes[n].nodeValue = txtnodes[n].nodeValue.replace(/([\S\u00A0])\u00A0/gi, "$1 ");
      }
    }

    // Clear element contents
    element.innerHTML = "";

    // Insert new DOM tree
    element.appendChild(fragment);

    return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;
  }