code: function (selector) {
          var self = this, i, l, matches = [], item, match;
  
          // Compile string into selector expression
          if (typeof selector === "string") {
            selector = new Selector(selector);
  
            match = function (item) {
              return selector.match(item);
            };
          } else {
            // Use selector as matching function
            match = selector;
          }
  
          for (i = 0, l = self.length; i < l; i++) {
            item = self[i];
  
            if (match(item)) {
              matches.push(item);
            }
          }
  
          return new Collection(matches);
        }
docs: Filters the collection item based on the specified selector expression or selector function.
  
  @method filter
  @param {String} selector Selector expression to filter items by.
  @return {tinymce.ui.Collection} Collection containing the filtered items.