Perform {@link Lava.system.ViewManager#addGlobalEventTarget} or {@link Lava.system.ViewManager#addGlobalRoleTarget}
@param {Object} storage
@param {string} name
@param {Lava.widget.Standard} widget
770376
function(storage, name, widget) {

		if (name in storage) {

			if (storage[name].indexOf(widget) == -1) {

				storage[name].push(widget);

			} else {

				Lava.logError('[ViewManager] Duplicate target: ' + name);

			}

		} else {

			storage[name] = [widget];

		}

	}
736111
public void addWorldGroup(String name) {
        if (!worldGroupExist(name)) {
            list.put(name, new WorldGroup(name));
        }
    }
1170597
public void addWindow(View view, String name) {
        mWindowsLock.writeLock().lock();
        try {
            mWindows.put(view.getRootView(), name);
        } finally {
            mWindowsLock.writeLock().unlock();
        }
        fireWindowsChangedEvent();
    }
1233767
function(add) {
			var act, sig = this.context.gui.$contextid;
			var type = gui.BROADCAST_KEYEVENT;
			if (this._global) {
				act = add ? "addGlobal" : "removeGlobal";
				gui.Broadcast[act](type, this);
			} else {
				act = add ? "add" : "remove";
				gui.Broadcast[act](type, this, sig);
			}
		}
907727
function(name, url, options) {
        if (options && options.sphericalMercator || this.sphericalMercator) {
            options = OpenLayers.Util.extend({
                projection: "EPSG:900913",
                numZoomLevels: 19
            }, options);
        }
        OpenLayers.Layer.Grid.prototype.initialize.apply(this, [
            name || this.name, url || this.url, {}, options
        ]);
    }
1352
function(event_name, target) {

		if (this._is_inDOM && event_name == 'click' && !(event_name in this._events)) {
			this.getDOMElement().onclick = Lava.noop;
		}
		this.addEventTarget_Normal(event_name, target)

	}
418390
void onResourceLaunchRequest(
      final ResourceLaunchEvent launchRequest) {

    synchronized (this.theContainers) {

      final Container c = this.theContainers.get(launchRequest.getIdentifier());

      try (final LoggingScope lb = this.loggingScopeFactory
          .getNewLoggingScope("ResourceManager.onResourceLaunchRequest:evaluatorConfigurationFile")) {
        // Add the global files and libraries.
        c.addGlobalFiles(this.fileNames.getGlobalFolder());
        c.addLocalFiles(getLocalFiles(launchRequest));

        // Make the configuration file of the evaluator.
        final File evaluatorConfigurationFile = new File(c.getFolder(), fileNames.getEvaluatorConfigurationPath());

        try {
          this.configurationSerializer.toFile(launchRequest.getEvaluatorConf(), evaluatorConfigurationFile);
        } catch (final IOException | BindException e) {
          throw new RuntimeException("Unable to write configuration.", e);
        }
      }

      try (final LoggingScope lc = this.loggingScopeFactory
          .getNewLoggingScope("ResourceManager.onResourceLaunchRequest:runCommand")) {

        final List<String> command = getLaunchCommand(launchRequest, c.getMemory());
        LOG.log(Level.FINEST, "Launching container: {0}", c);
        c.run(command);
      }
    }
  }
93315
function addListener(name) {
  if (name !== 'collect') {
    return;
  }

  if (this._collecting) {
    // Don't add more than once
    return;
  }

  debug('adding collect method', this._readableState.objectMode, this._readableState.encoding);

  let collected;
  if (this._readableState.objectMode) {
    collected = [];
  } else if (this._readableState.encoding === null) {
    collected = Buffer.from('');
  } else {
    collected = '';
  }

  this
    .on('readable', () => {
      let chunk;
      while ((chunk = this.read()) !== null) {
        debug('data', chunk);

        if (chunk !== null) {
          if (this._readableState.objectMode) {
            collected.push(chunk);
          } else if (this._readableState.encoding === null) {
            collected = Buffer.concat([collected, chunk]);
          } else {
            collected += chunk;
          }
        }
      }
    })
    .on('end', () => this.emit('collect', collected));

  this._collecting = true;
}
768746
@Override
   public synchronized void registerInternalCache(String name, Configuration configuration, EnumSet<Flag> flags) {
      boolean configPresent = cacheManager.getCacheConfiguration(name) != null;
      // check if it already has been defined. Currently we don't support existing user-defined configuration.
      if ((flags.contains(Flag.EXCLUSIVE) || !internalCaches.containsKey(name)) && configPresent) {
         throw log.existingConfigForInternalCache(name);
      }
      // Don't redefine
      if (configPresent) {
         return;
      }
      ConfigurationBuilder builder = new ConfigurationBuilder().read(configuration);
      builder.jmxStatistics().disable(); // Internal caches must not be included in stats counts
      GlobalConfiguration globalConfiguration = cacheManager.getCacheManagerConfiguration();
      if (flags.contains(Flag.GLOBAL) && globalConfiguration.isClustered()) {
         // TODO: choose a merge policy
         builder.clustering()
               .cacheMode(CacheMode.REPL_SYNC)
               .stateTransfer().fetchInMemoryState(true).awaitInitialTransfer(true);
      }
      if (flags.contains(Flag.PERSISTENT) && globalConfiguration.globalState().enabled()) {
         builder.persistence().addSingleFileStore().location(globalConfiguration.globalState().persistentLocation()).purgeOnStartup(false).preload(true).fetchPersistentState(true);
      }
      SecurityActions.defineConfiguration(cacheManager, name, builder.build());
      internalCaches.put(name, flags);
      if (!flags.contains(Flag.USER)) {
         privateCaches.add(name);
      }
   }
569879
function(name, options) {
        options = options || {};
        if(!options.version) {
            options.version = typeof GMap2 === "function" ? "2" : "3";
        }
        var mixin = OpenLayers.Layer.Google["v" +
            options.version.replace(/\./g, "_")];
        if (mixin) {
            OpenLayers.Util.applyDefaults(options, mixin);
        } else {
            throw "Unsupported Google Maps API version: " + options.version;
        }

        OpenLayers.Util.applyDefaults(options, mixin.DEFAULTS);
        if (options.maxExtent) {
            options.maxExtent = options.maxExtent.clone();
        }

        OpenLayers.Layer.EventPane.prototype.initialize.apply(this,
            [name, options]);
        OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this, 
            [name, options]);

        if (this.sphericalMercator) {
            OpenLayers.Util.extend(this, OpenLayers.Layer.SphericalMercator);
            this.initMercatorParameters();
        }    
    }
6820
function(name) {

		if (Lava.schema.DEBUG && !name) Lava.t();

		var result = this._widget;

		while (result && result.name != name) {

			result = result.getParentWidget();

		}

		return result;

	}
168108
public void addTransition(QName name, ElementSelector<T> target) {
        buildState().addTransition(new ElementEqualsConstraint(name), 
                                   target.buildState());
    }
1124492
public static final void setApplId(byte[] name)
    {
        if (tc.isDebugEnabled())
            Tr.debug(tc, "setApplId", name);

        // Store the applId.
        applId = name;
    }
668826
public function addStorage($name, $storage)
    {

        $isClosure = $storage instanceof Closure;

        if ($name == self::DEFAULT_STORAGE) {
            $this->storage = $isClosure ? $storage($name) : $storage;
            $this->storages[$name] = $this->storage;
            return $this;
        }

        if ($isClosure) {
            $this->bindings[$name] = $storage;
            return $this;
        }

        $this->storages[$name] = $storage;

        return $this;
    }
865862
public WellRestedRequestBuilder addGlobalHeader(String name, String value) {
        if (this.globalHeaders == null) {
            this.globalHeaders = new ArrayList<>();
        }
        this.globalHeaders.add(new BasicHeader(name, value));
        return this;
    }
683722
public static synchronized void addDefaultResource(String name) {
		if(!defaultResources.contains(name)) {
			defaultResources.add(name);
			for(Configuration conf : REGISTRY.keySet()) {
				if(conf.loadDefaults) {
					conf.reloadConfiguration();
				}
			}
		}
	}
540125
def on_add(self, widget, data=None):
        
        gv_name = "new_global_%s" % self.global_variable_counter
        self.global_variable_counter += 1
        try:
            self.model.global_variable_manager.set_variable(gv_name, None)
        except (RuntimeError, AttributeError, TypeError) as e:
            logger.warning("Addition of new global variable '{0}' failed: {1}".format(gv_name, e))
        self.select_entry(gv_name)
        return True