Called once when component is attached. Generally for initial setup.
321933
function () {

    var self = this;

    // Next two vars used to control transport bar with keyboard arrows

    this.bar_steps = 10.0;

    this.current_step = 0.0;

    this.el.setAttribute("visible", true);

    this.video_selector = this.data.src;

    this.video_el = document.querySelector(this.video_selector);

    // image sources for play/pause

    self.play_image_src = document.getElementById("video-play-image") ? "#video-play-image" : "https://res.cloudinary.com/dxbh0pppv/image/upload/c_scale,h_512,q_10/v1471016296/play_wvmogo.png";
    self.pause_image_src = document.getElementById("video-pause-image") ? "#video-pause-image" :"https://res.cloudinary.com/dxbh0pppv/image/upload/c_scale,h_512,q_25/v1471016296/pause_ndega5.png";

    // Create icon image (play/pause), different image whether video is playing.

    this.play_image = document.createElement("a-image");

    if (this.video_el.paused) {
      this.play_image.setAttribute("src", self.play_image_src);
    } else {
      this.play_image.setAttribute("src", self.pause_image_src);
    }

    // Change icon to 'play' on end

    this.video_el.addEventListener("ended", function(){

        self.play_image.setAttribute("src", self.play_image_src);

    });

    // Change icon to 'pause' on start.

    this.video_el.addEventListener("pause", function(){

        self.play_image.setAttribute("src", self.play_image_src);

    });

    // Change icon to 'play' on pause.

    this.video_el.addEventListener("playing", function(){

        self.play_image.setAttribute("src", self.pause_image_src);

    });

    this.bar_canvas = document.createElement("canvas");
    this.bar_canvas.setAttribute("id", "video_player_canvas");
    this.bar_canvas.width = 1024;
    this.bar_canvas.height = 256;
    this.bar_canvas.style.display = "none";

    this.context = this.bar_canvas.getContext('2d');

    this.texture = new THREE.Texture(this.bar_canvas);

    // On icon image, change video state and icon (play/pause)

    this.play_image.addEventListener('click', function (event) {

        if(!self.video_el.paused){
            this.setAttribute("src", self.play_image_src);

            self.video_el.pause();

        }
        else {
            this.setAttribute("src", self.pause_image_src);

            self.video_el.play();

        }

        // Prevent propagation upwards (e.g: canvas click)

        event.stopPropagation();

        event.preventDefault();

    });


    window.addEventListener('keyup', function(event) {
      switch (event.keyCode) {

        // If space bar is pressed, fire click on play_image
        case 32:
          self.play_image.dispatchEvent(new Event('click'));
        break;

        // Arrow left: beginning
        case 37:
           self.current_step = 0.0;
           self.position_time_from_steps();
        break;

        // Arrow right: end
        case 39:
           self.current_step = self.bar_steps;
           self.position_time_from_steps();

        break;

        // Arrow up: one step forward
        case 38:
           self.current_step = self.current_step < (self.bar_steps) ? self.current_step + 1 : self.current_step;
           self.position_time_from_steps();
        break;

        // Arrow down: one step back
        case 40:
           self.current_step = self.current_step > 0 ? self.current_step - 1 : self.current_step;
           self.position_time_from_steps();
        break;

      }
    }, false);


    // Create transport bar

    this.bar = document.createElement("a-plane");
    this.bar.setAttribute("color", "#000");

    // On transport bar click, get point clicked, infer % of new pointer, and make video seek to that point

    this.bar.addEventListener('click', function (event) {

        // Get raycast intersection point, and from there, x_offset in bar

        var point = document.querySelector("a-cursor").components.raycaster.raycaster.intersectObject(this.object3D, true)[0].point;

        var x_offset = this.object3D.worldToLocal(point).x;

        var unit_offset = (x_offset/self.data.size)+0.5;

        // Update current step for coherence between point+click and key methods

        self.current_step = Math.round(unit_offset*self.bar_steps);

        if(self.video_el.readyState > 0) {

            self.video_el.currentTime = unit_offset * self.video_el.duration;
        }

        // Prevent propagation upwards (e.g: canvas click)

        event.stopPropagation();

        event.preventDefault();

    });

    // Append image icon + info text + bar to component root

    this.el.appendChild(this.bar_canvas);
    this.el.appendChild(this.play_image);
    this.el.appendChild(this.bar);


    // Attach double click behavior outside player once scene is loaded

    this.el.sceneEl.addEventListener("loaded", function(){

        self.position_control_from_camera();

        this.addEventListener("dblclick", function(){

            var raycaster = document.querySelector("a-cursor").components.raycaster.raycaster;

            // Double click is outside the player
            // (note that for some reason you cannot prevent a dblclick on player from bubbling up (??)

            if(raycaster.intersectObject(self.el.object3D, true).length == 0){

                // If controls are show: hide


                if(self.el.getAttribute("visible")) {
                    self.el.setAttribute("visible", false);
                }
                // Else, show at 'distance' from camera
                else {
                    self.el.setAttribute("visible", true);

                    self.position_control_from_camera();
                }
            }

        });


    });

  }
1313016
public void addInitConstraint (InitComponent lhs, Constraint constraint, InitComponent rhs)
    {
        if (lhs == null || rhs == null) {
            throw new IllegalArgumentException("Cannot add constraint about null component.");
        }
        InitComponent before = (constraint == Constraint.RUNS_BEFORE) ? lhs : rhs;
        InitComponent after = (constraint == Constraint.RUNS_BEFORE) ? rhs : lhs;
        _initers.addDependency(after, before);
    }
164801
protected void initComponent()
	{
		addOrReplace(form = newForm("form", getModel()));
		form.addOrReplace(signupPanel = newSignupPanel("signupPanel", getModel()));

		form.addOrReplace(submitButton = newButton("signupButton"));
		submitButton.add(
			buttonLabel = newButtonLabel("buttonLabel", "global.button.sign.up.label", "Sign up"));
		form.add(submitButton);

		form.add(new EqualPasswordInputValidator(
			signupPanel.getSigninPanel().getPassword().getPasswordTextField(),
			signupPanel.getRepeatPassword().getPasswordTextField()));
	}
339944
@Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ensureContent();
    }
927680
@Override public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_tv_shows_sample);
    ButterKnife.inject(this);
    initializeDraggableView();
    initializeGridView();
    hookListeners();
  }
1002862
@Override
    protected void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (LOG_ATTACH_DETACH) {
            Log.d(TAG, "onAttachedToWindow reattach =" + mDetached);
        }
        if (mDetached && (mRenderer != null)) {
            int renderMode = RENDERMODE_CONTINUOUSLY;
            if (mGLThread != null) {
                renderMode = mGLThread.getRenderMode();
            }
            mGLThread = new GLThread(mThisWeakRef);
            if (renderMode != RENDERMODE_CONTINUOUSLY) {
                mGLThread.setRenderMode(renderMode);
            }
            mGLThread.start();
        }
        mDetached = false;
    }
10915
private function componentsReady()
    {
        $this->getRegistryCache()->isAppReady();

        if ($this->componentsloaded) {
            foreach ($this->components as $component) {
                $component->ready($this);
            }
        }
    }
291845
private void registerThis()
    {
        DefaultComponentDescriptor<ComponentManager> cd = new DefaultComponentDescriptor<>();
        cd.setRoleType(ComponentManager.class);

        registerComponent(cd, this);
    }
346155
def configure_once(config=None, bind_in_runtime=True):
    """"""
    with _INJECTOR_LOCK:
        if _INJECTOR:
            return _INJECTOR

        return configure(config, bind_in_runtime=bind_in_runtime)
1339530
private void initialize() {
    this.setSize(300, 200);
    this.setTitle("Connect");
    this.setContentPane(getJContentPane());
    this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    this.addWindowListener(new WindowAdapter() {
      public void windowClosed(WindowEvent e) {
        cancelTimeout();
      }
    });

    Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
      public void eventDispatched(AWTEvent e) {
        if ((e instanceof KeyEvent && ((KeyEvent) e).getID() == KeyEvent.KEY_PRESSED)
            || (e instanceof MouseEvent && ((MouseEvent) e).getID() == MouseEvent.MOUSE_PRESSED)) {
          if (ConnectionDialog.this.isAncestorOf(((ComponentEvent) e).getComponent())) {
            cancelTimeout();
          }
        }
      }
    }, AWTEvent.KEY_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
    restore();
  }
1006393
function init() {
      var _this = this;

      this._shouldSyncFromOpts = true;
      this.on('update', function () {
        if (_this._shouldSyncFromOpts) _this.trigger('sync');
        _this._shouldSyncFromOpts = true;
      });
    }
1183033
@Override
    public void afterInitialized(BaseComponent comp) {
        super.afterInitialized(comp);
        window = (Window) comp;
        sessionId = (String) comp.getAttribute("id");
        lstParticipants.setRenderer(new ParticipantRenderer(chatService.getSelf(), null));
        model.add(chatService.getSelf());
        lstParticipants.setModel(model);
        clearMessage();
        
        if (comp.getAttribute("originator") != null) {
            invite((result) -> {
                if (!result) {
                    close();
                } else {
                    initSession();
                }
            });
        }
57927
function (component) {
    var callbacks = this.callbacks;
    if (component.beforeStep) {
      callbacks.beforeStep.splice(callbacks.beforeStep.indexOf(component), 1);
    }
    if (component.step) {
      callbacks.step.splice(callbacks.step.indexOf(component), 1);
    }
    if (component.afterStep) {
      callbacks.afterStep.splice(callbacks.afterStep.indexOf(component), 1);
    }
  }
656490
public void addComponent (BaseComponent comp)
    {
        if (comp instanceof InitComponent) {
            if (_initers == null) {
                throw new IllegalStateException("Too late to register InitComponent.");
            }
            _initers.add((InitComponent)comp);
        }
        if (comp instanceof ShutdownComponent) {
            if (_downers == null) {
                throw new IllegalStateException("Too late to register ShutdownComponent.");
            }
            _downers.add((ShutdownComponent)comp);
        }
    }
886872
function () {
			this.router = UIComponent.getRouterFor(this);
			this.router.attachRoutePatternMatched(this.onRouteMatched, this);
			this._component = Component.getOwnerComponentFor(this.getView());
			// click handler for @link tags in JSdoc fragments
			this.getView().attachBrowserEvent("click", this.onJSDocLinkClick, this);

			this.getView().addEventDelegate({
				onBeforeFirstShow: jQuery.proxy(this._applyViewConfigurations, this)
			});
		}
924522
def on_startup(self):
        

        LOGGER.debug("> Calling '{0}' Component Framework 'on_startup' method.".format(self.__class__.__name__))

        self.refresh_nodes.emit()
        return True
798676
public static function setup(): void
    {
        $aComponents          = Components::available();
        self::$aContainers    = [];
        self::$aLoadedHelpers = [];
        $aDiscoveredServices  = [
            'nails/common' => self::findServicesForComponent('nails/common'),
        ];

        foreach ($aComponents as $oComponent) {
            $aDiscoveredServices[$oComponent->slug] = self::findServicesForComponent($oComponent->slug);
        }

        $aDiscoveredServices['app'] = self::findServicesForApp();
        $aDiscoveredServices        = array_filter($aDiscoveredServices);

        foreach ($aDiscoveredServices as $sComponentName => $aComponentServices) {

            //  Properties
            if (!empty($aComponentServices['properties'])) {
                if (empty(self::$aContainers[$sComponentName]['properties'])) {
                    self::$aContainers[$sComponentName]['properties'] = new Container();
                }
                foreach ($aComponentServices['properties'] as $sKey => $mValue) {
                    self::$aContainers[$sComponentName]['properties'][$sKey] = $mValue;
                }
            }

            // --------------------------------------------------------------------------

            /**
             * SERVICES
             * All services are wrapped in a closure, this is so that on fetch we can
             * pass in any additional arguments as parameters which can be used in the
             * item's constructor
             */
            if (!empty($aComponentServices['services'])) {
                if (empty(self::$aContainers[$sComponentName]['services'])) {
                    self::$aContainers[$sComponentName]['services'] = new Container();
                }
                foreach ($aComponentServices['services'] as $sKey => $cCallable) {
                    self::$aContainers[$sComponentName]['services'][$sKey] = function () use ($sKey, $cCallable) {
                        return $cCallable;
                    };;
                }
            }

            // --------------------------------------------------------------------------

            /**
             * MODELS
             * All models are wrapped in a closure, this is so that on fetch we can
             * pass in any additional arguments as parameters which can be used in the
             * item's constructor
             */
            if (!empty($aComponentServices['models'])) {
                if (empty(self::$aContainers[$sComponentName]['models'])) {
                    self::$aContainers[$sComponentName]['models'] = new Container();
                }
                foreach ($aComponentServices['models'] as $sKey => $cCallable) {
                    self::$aContainers[$sComponentName]['models'][$sKey] = function () use ($cCallable) {
                        return $cCallable;
                    };
                }
            }

            // --------------------------------------------------------------------------

            /**
             * FACTORIES
             * All factories are wrapped in a closure, this is so that on fetch we can
             * pass in any additional arguments as parameters which can be used in the
             * item's constructor
             */
            if (!empty($aComponentServices['factories'])) {
                if (empty(self::$aContainers[$sComponentName]['factories'])) {
                    self::$aContainers[$sComponentName]['factories'] = new Container();
                }
                foreach ($aComponentServices['factories'] as $sKey => $cCallable) {

                    $cWrapper = function () use ($cCallable) {
                        return $cCallable;
                    };

                    self::$aContainers[$sComponentName]['factories'][$sKey] = self::$aContainers[$sComponentName]['factories']
                        ->factory($cWrapper);
                }
            }

            // --------------------------------------------------------------------------

            /**
             * FACTORIES
             * All factories are wrapped in a closure, this is so that on fetch we can
             * pass in any additional arguments as parameters which can be used in the
             * item's constructor
             */
            if (!empty($aComponentServices['resources'])) {
                if (empty(self::$aContainers[$sComponentName]['resources'])) {
                    self::$aContainers[$sComponentName]['resources'] = new Container();
                }
                foreach ($aComponentServices['resources'] as $sKey => $cCallable) {

                    $cWrapper = function () use ($cCallable) {
                        return $cCallable;
                    };

                    self::$aContainers[$sComponentName]['resources'][$sKey] = self::$aContainers[$sComponentName]['resources']
                        ->factory($cWrapper);
                }
            }
        }
    }