Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
22 | 2 | 2 | 0.976 | SourceElements[2] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 22 | 89 | Closure/closure/goog/ui/containerrenderer.js |
2 | 22 | 111 | Closure/closure/goog/ui/controlrenderer.js |
| ||||
/** * Constructs a new renderer and sets the CSS class that the renderer will use * as the base CSS class to apply to all elements rendered by that renderer. * An example to use this function using a menu is: * * <pre> * var myCustomRenderer = goog.ui.ContainerRenderer.getCustomRenderer( * goog.ui.MenuRenderer, 'my-special-menu'); * var newMenu = new goog.ui.Menu(opt_domHelper, myCustomRenderer); * </pre> * * Your styles for the menu can now be: * <pre> * .my-special-menu { } * </pre> * * <em>instead</em> of * <pre> * .CSS_MY_SPECIAL_MENU .goog-menu { } * </pre> * * You would want to use this functionality when you want an instance of a * component to have specific styles different than the other components of the * same type in your application. This avoids using descendant selectors to * apply the specific styles to this component. * * @param {Function} ctor The constructor of the renderer you want to create. * @param {string} cssClassName The name of the CSS class for this renderer. * @return {goog.ui.ContainerRenderer} An instance of the desired renderer with * its getCssClass() method overridden to return the supplied custom CSS * class name. */ goog.ui.ContainerRenderer.getCustomRenderer= function (ctor, cssClassName){ var renderer= new ctor( ); /** * Returns the CSS class to be applied to the root element of components * rendered using this renderer. * @return {string} Renderer-specific CSS class. */ renderer.getCssClass= function ( ) { return cssClassName; } ; return renderer; } ; /** * Default CSS class to be applied to the root element of containers rendered * by this renderer. * @type {string} */ goog.ui.ContainerRenderer.CSS_CLASS= goog.getCssName('goog-container'); |
| ||||
/** * Constructs a new renderer and sets the CSS class that the renderer will use * as the base CSS class to apply to all elements rendered by that renderer. * An example to use this function using a color palette: * * <pre> * var myCustomRenderer = goog.ui.ControlRenderer.getCustomRenderer( * goog.ui.PaletteRenderer, 'my-special-palette'); * var newColorPalette = new goog.ui.ColorPalette( * colors, myCustomRenderer, opt_domHelper); * </pre> * * Your CSS can look like this now: * <pre> * .my-special-palette { } * .my-special-palette-table { } * .my-special-palette-cell { } * etc. * </pre> * * <em>instead</em> of * <pre> * .CSS_MY_SPECIAL_PALETTE .goog-palette { } * .CSS_MY_SPECIAL_PALETTE .goog-palette-table { } * .CSS_MY_SPECIAL_PALETTE .goog-palette-cell { } * etc. * </pre> * * You would want to use this functionality when you want an instance of a * component to have specific styles different than the other components of the * same type in your application. This avoids using descendant selectors to * apply the specific styles to this component. * * @param {Function} ctor The constructor of the renderer you are trying to * create. * @param {string} cssClassName The name of the CSS class for this renderer. * @return {goog.ui.ControlRenderer} An instance of the desired renderer with * its getCssClass() method overridden to return the supplied custom CSS * class name. */ goog.ui.ControlRenderer.getCustomRenderer= function (ctor, cssClassName){ var renderer= new ctor( ); /** * Returns the CSS class to be applied to the root element of components * rendered using this renderer. * @return {string} Renderer-specific CSS class. */ renderer.getCssClass= function ( ) { return cssClassName; } ; return renderer; } ; /** * Default CSS class to be applied to the root element of components rendered * by this renderer. * @type {string} */ goog.ui.ControlRenderer.CSS_CLASS= goog.getCssName('goog-control'); |
| |||
/** * Constructs a new renderer and sets the CSS class that the renderer will use * as the base CSS class to apply to all elements rendered by that renderer. * An example to use this function using a color palette: * * <pre> * var myCustomRenderer = goog.ui.ControlRenderer.getCustomRenderer( * goog.ui.PaletteRenderer, 'my-special-palette'); * var newColorPalette = new goog.ui.ColorPalette( * colors, myCustomRenderer, opt_domHelper); * </pre> * * Your CSS can look like this now: * <pre> * .my-special-palette { } * .my-special-palette-table { } * .my-special-palette-cell { } * etc. * </pre> * * <em>instead</em> of * <pre> * .CSS_MY_SPECIAL_PALETTE .goog-palette { } * .CSS_MY_SPECIAL_PALETTE .goog-palette-table { } * .CSS_MY_SPECIAL_PALETTE .goog-palette-cell { } * etc. * </pre> * * You would want to use this functionality when you want an instance of a * component to have specific styles different than the other components of the * same type in your application. This avoids using descendant selectors to * apply the specific styles to this component. * * @param {Function} ctor The constructor of the renderer you are trying to * create. * @param {string} cssClassName The name of the CSS class for this renderer. * @return {goog.ui.ControlRenderer} An instance of the desired renderer with * its getCssClass() method overridden to return the supplied custom CSS * class name. */ /** * Constructs a new renderer and sets the CSS class that the renderer will use * as the base CSS class to apply to all elements rendered by that renderer. * An example to use this function using a menu is: * * <pre> * var myCustomRenderer = goog.ui.ContainerRenderer.getCustomRenderer( * goog.ui.MenuRenderer, 'my-special-menu'); * var newMenu = new goog.ui.Menu(opt_domHelper, myCustomRenderer); * </pre> * * Your styles for the menu can now be: * <pre> * .my-special-menu { } * </pre> * * <em>instead</em> of * <pre> * .CSS_MY_SPECIAL_MENU .goog-menu { } * </pre> * * You would want to use this functionality when you want an instance of a * component to have specific styles different than the other components of the * same type in your application. This avoids using descendant selectors to * apply the specific styles to this component. * * @param {Function} ctor The constructor of the renderer you want to create. * @param {string} cssClassName The name of the CSS class for this renderer. * @return {goog.ui.ContainerRenderer} An instance of the desired renderer with * its getCssClass() method overridden to return the supplied custom CSS * class name. */ goog.ui. [[#variable62c247e0]].getCustomRenderer= function (ctor,cssClassName) { var renderer=new ctor( ); /** * Returns the CSS class to be applied to the root element of components * rendered using this renderer. * @return {string} Renderer-specific CSS class. */ renderer.getCssClass= function ( ) { return cssClassName; } ; return renderer; } ; /** * Default CSS class to be applied to the root element of components rendered * by this renderer. * @type {string} */ /** * Default CSS class to be applied to the root element of containers rendered * by this renderer. * @type {string} */ goog.ui. [[#variable62c247e0]].CSS_CLASS=goog.getCssName( [[#variable62c253e0]]); |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#62c247e0]] | ControlRenderer |
1 | 2 | [[#62c247e0]] | ContainerRenderer |
2 | 1 | [[#62c253e0]] | 'goog-control' |
2 | 2 | [[#62c253e0]] | 'goog-container' |