APIMethod: addControls
To build a toolbar, you add a set of controls to it. addControls
lets you add a single control or a list of controls to the
Control Panel.

Parameters:
controls - {<OpenLayers.Control>} Controls to add in the panel.
333200
function(controls) {
        if (!(OpenLayers.Util.isArray(controls))) {
            controls = [controls];
        }
        this.controls = this.controls.concat(controls);

        for (var i=0, len=controls.length; i<len; i++) {
            var control = controls[i],
                element = this.createControlMarkup(control);
            OpenLayers.Element.addClass(element, 
                                        control.displayClass + "ItemInactive");
            OpenLayers.Element.addClass(element, "olButton");
            if (control.title != ""  && !element.title) {
                element.title = control.title;
            }
            control.panel_div = element;
        }

        if (this.map) { // map.addControl() has already been called on the panel
            this.addControlsToMap(controls);
            this.redraw();
        }
    }
1345565
private void addHoverHandlers(FocusPanel panel) {

        final CmsStyleVariable hoverVar = new CmsStyleVariable(panel);
        hoverVar.setValue(I_CmsLayoutBundle.INSTANCE.globalWidgetCss().openerNoHover());
        panel.addMouseOverHandler(new MouseOverHandler() {

            /**
             * @see com.google.gwt.event.dom.client.MouseOverHandler#onMouseOver(com.google.gwt.event.dom.client.MouseOverEvent)
             */
            public void onMouseOver(MouseOverEvent event) {

                hoverVar.setValue(I_CmsLayoutBundle.INSTANCE.globalWidgetCss().openerHover());
            }
        });

        panel.addMouseOutHandler(new MouseOutHandler() {

            /**
             * @see com.google.gwt.event.dom.client.MouseOutHandler#onMouseOut(com.google.gwt.event.dom.client.MouseOutEvent)
             */
            public void onMouseOut(MouseOutEvent event) {

                hoverVar.setValue(I_CmsLayoutBundle.INSTANCE.globalWidgetCss().openerNoHover());
            }
        });

    }
1228529
public DynaFormControl addControl(final Object data, final int colspan, final int rowspan) {
        return addControl(data, DynaFormControl.DEFAULT_TYPE, colspan, rowspan);
    }
1052635
function addClass(controls) {
      var settings = Glide.settings;
      var item = controls[Glide.index];

      if (item) {
        item.classList.add(settings.classes.activeNav);

        siblings(item).forEach(function (sibling) {
          sibling.classList.remove(settings.classes.activeNav);
        });
      }
    }
833913
public function build()
    {
        if (empty($this->form)) {
            Throw new ControlException('Editbox control needs a set FormDesigner or Form object.');
        }

        // Editbox CSS class needed
        $this->panel->html->addCss('editbox');

        // Create panel heading with title
        $heading = $this->panel->createHeading();

        $title = $heading->createTitle();
        $title->setTitle($this->caption);

        if (! empty($this->description)) {
            $title->setDescription($this->description, true);
        }

        $heading->addContent($title);

        // Create panel body

        if ($this->form instanceof FormDesigner) {
            $form_id = $this->form->html->getId();
            $form_action = $this->form->html->getAttribute('action');

            // Ajax form?
            $this->is_ajax = $this->form->getSendMode() == 'ajax' ? true : false;
        }
        else {
            $form_id = $this->form->getId();
            $form_action = $this->form->getAttribute('action');
        }

        // Build form here because it's possible that form id will be autogenerated
        // and we need this id in the next step.
        $body = $this->panel->createBody();
        $body->addContent($this->form);

        // Footer with toolbar

        /* @var $toolbar \Core\Html\Bootstrap\Buttongroups\ButtonToolbar */
        $toolbar = $this->factory->create('Bootstrap\Buttongroups\ButtonToolbar');

        $create_action = function (Action $action, $with_link = false) {

            $text = $action->getText();
            $icon = $action->getIcon();

            if (! empty($icon)) {
                $text = $icon->build() . ' ' . $text;
            }

            if ($with_link) {

                $href = $action->getHref();

                if (! empty($href)) {

                    /* @var $a \Core\Html\Elements\A */
                    $a = $this->factory->create('Elements\A');

                    $a->setHref($href);

                    if ($action->getAjax()) {
                        $a->addData('ajax');
                    }

                    if ($action->getConfirm()) {
                        $a->addData('confirm', $action->getConfirm());
                    }

                    $a->setInner($text);

                    $text = $a->build();
                }
            }
            return $text;
        };

        // Make sure that he buttons have the correct order
        ksort($this->actions);

        foreach ($this->actions as $type => $action) {

            switch ($type) {
                case 0:
                case 1:

                    /* @var $group \Core\Html\Bootstrap\Buttongroups\ButtonGroup */
                    $group = $toolbar->createButtongroup();
                    $group->addCss('btn-group-sm');

                    switch ($type) {
                        case 0:

                            $button = $group->createButton();
                            $button->setFormId($form_id);
                            $button->setFormAction($form_action);
                            $button->isSuccess();

                            if ($this->is_ajax) {
                                $button->addData('ajax');
                            }
                            else {
                                $button->setType('submit');
                            }

                            break;

                        case 1:
                            $group->addCss('pull-right');

                            /* @var $button \Core\Html\Controls\UiButton */
                            $button = $group->createButton('Controls\UiButton');
                            $button->setHref($action->getHref());
                            $button->addCss('btn-danger');

                            if ($this->is_ajax) {
                                $button->addData('ajax');
                            }
                            break;
                    }

                    $button->setInner($create_action($this->actions[$type]));

                    break;

                case 2:
                default:

                    /* @var $group \Core\Html\Bootstrap\Buttongroups\ButtonGroup */
                    $group = $toolbar->createButtongroup();
                    $group->addCss('btn-group-sm pull-right dropup');

                    /* @var $context_menu \Core\Html\Form\Button */
                    $context_menu = $this->factory->create('Bootstrap\Button\Button');
                    $context_menu->addCss('dropdown-toggle');
                    $context_menu->addAria([
                        'haspopup' => "true",
                        'expanded' => "false"
                    ]);
                    $context_menu->addData('toggle', 'dropdown');

                    // Do we have a text to show on actions button?
                    if (! empty($this->context_text)) {
                        $context_menu->addInner($this->context_text . ' ');
                    }

                    $context_menu->addInner('<span class="caret"></span>');

                    $group->setInner($context_menu->build());

                    // Create the actions dropdown menu
                    $dropdown = '<ul class="dropdown-menu">';

                    foreach ($this->actions[$type] as $action) {
                        $dropdown .= '<li>' . $create_action($action, true) . '</li>';
                    }

                    $dropdown .= '</ul>';

                    $group->addInner($dropdown);

                    break;
            }
        }

        $footer = $this->panel->createFooter();
        $footer->addContent($toolbar);

        return $this->panel->build();
    }
1340932
function setupControls () {

      window.addEventListener('keydown', function () {
        startControlsTimeOut();
      });

      playButton.addEventListener('click', function () {
        bigscreenPlayer.play();
        startControlsTimeOut();
      });

      pauseButton.addEventListener('click', function () {
        bigscreenPlayer.pause();
        startControlsTimeOut();
      });

      seekForwardButton.addEventListener('click', function () {
        bigscreenPlayer.setCurrentTime(bigscreenPlayer.getCurrentTime() + 10);
        startControlsTimeOut();
      });

      seekBackButton.addEventListener('click', function () {
        bigscreenPlayer.setCurrentTime(bigscreenPlayer.getCurrentTime() - 10);
        startControlsTimeOut();
      });

      seekToEndButton.addEventListener('click', function () {
        bigscreenPlayer.setCurrentTime(bigscreenPlayer.getDuration() - 10);
        startControlsTimeOut();
      });

      debugToolButton.addEventListener('click', function () {
        DebugTool.toggleVisibility();
        startControlsTimeOut();
      });

      bigscreenPlayer.registerForTimeUpdates(function (event) {
      });

      bigscreenPlayer.registerForStateChanges(function (event) {
        var state = 'EMPTY';
        switch (event.state) {
          case 0: state = 'STOPPED'; break;
          case 1: state = 'PAUSED'; break;
          case 2: state = 'PLAYING'; break;
          case 4: state = 'WAITING'; break;
          case 5: state = 'ENDED'; break;
          case 6: state = 'FATAL_ERROR'; break;
        }
        if (state === 'WAITING') {
          playbackElement.appendChild(playbackSpinner);
        } else {
          playbackElement.removeChild(playbackSpinner);
        }
      });
    }
106280
def CreateControls(self, config_parser):
        """"""
        self.CreateMenuBar()
        self.SetupToolBar()
        self.CreateStatusBar()
        self.leftSplitter = wx.SplitterWindow(
            self
        )
        self.rightSplitter = wx.SplitterWindow(
            self.leftSplitter
        )
        self.listControl = listviews.DataView(
            self.leftSplitter,
            columns = PROFILE_VIEW_COLUMNS,
            name='mainlist',
        )
        self.squareMap = squaremap.SquareMap(
            self.rightSplitter,
            padding = 6,
            labels = True,
            adapter = self.adapter,
            square_style = True,
        )
        self.tabs = wx.Notebook(
            self.rightSplitter,
        )

        self.CreateSourceWindow(self.tabs)
        
        self.calleeListControl = listviews.DataView(
            self.tabs,
            columns = PROFILE_VIEW_COLUMNS,
            name='callee',
        )
        self.allCalleeListControl = listviews.DataView(
            self.tabs,
            columns = PROFILE_VIEW_COLUMNS,
            name='allcallee',
        )
        self.allCallerListControl = listviews.DataView(
            self.tabs,
            columns = PROFILE_VIEW_COLUMNS,
            name='allcaller',
        )
        self.callerListControl = listviews.DataView(
            self.tabs,
            columns = PROFILE_VIEW_COLUMNS,
            name='caller',
        )
        self.ProfileListControls = [
            self.listControl,
            self.calleeListControl,
            self.allCalleeListControl,
            self.callerListControl,
            self.allCallerListControl,
        ]
        self.tabs.AddPage(self.calleeListControl, _('Callees'), True)
        self.tabs.AddPage(self.allCalleeListControl, _('All Callees'), False)
        self.tabs.AddPage(self.callerListControl, _('Callers'), False)
        self.tabs.AddPage(self.allCallerListControl, _('All Callers'), False)
        if editor:
            self.tabs.AddPage(self.sourceCodeControl, _('Source Code'), False)
        self.rightSplitter.SetSashSize(10)
        # calculate size as proportional value for initial display...
        self.LoadState( config_parser )
        width, height = self.GetSizeTuple()
        rightsplit = 2 * (height // 3)
        leftsplit = width // 3
        self.rightSplitter.SplitHorizontally(self.squareMap, self.tabs,
                                             rightsplit)
        self.leftSplitter.SplitVertically(self.listControl, self.rightSplitter,
                                          leftsplit)
        squaremap.EVT_SQUARE_HIGHLIGHTED(self.squareMap,
                                         self.OnSquareHighlightedMap)
        squaremap.EVT_SQUARE_SELECTED(self.listControl,
                                      self.OnSquareSelectedList)
        squaremap.EVT_SQUARE_SELECTED(self.squareMap, self.OnSquareSelectedMap)
        squaremap.EVT_SQUARE_ACTIVATED(self.squareMap, self.OnNodeActivated)
        for control in self.ProfileListControls:
            squaremap.EVT_SQUARE_ACTIVATED(control, self.OnNodeActivated)
            squaremap.EVT_SQUARE_HIGHLIGHTED(control,
                                             self.OnSquareHighlightedList)
        self.moreSquareViewItem.Check(self.squareMap.square_style)
126595
private void buildControl() {
		buildControlPanel.reset();
		buildTargetPanel.reset();

		// Setup Trigger
		setupTrigger();

		// Create target
		SubordinateTarget target = setupTarget();

		// Create Actions
		com.github.bordertech.wcomponents.subordinate.Action trueAction;
		com.github.bordertech.wcomponents.subordinate.Action falseAction;

		switch ((ControlActionType) drpActionType.getSelected()) {
			case ENABLE_DISABLE:
				trueAction = new Enable(target);
				falseAction = new Disable(target);
				break;

			case SHOW_HIDE:
				trueAction = new Show(target);
				falseAction = new Hide(target);
				break;

			case MAN_OPT:
				trueAction = new Mandatory(target);
				falseAction = new Optional(target);
				break;

			case SHOWIN_HIDEIN:
				trueAction = new ShowInGroup(target, targetGroup);
				falseAction = new HideInGroup(target, targetGroup);
				break;

			case ENABLEIN_DISABLEIN:
				trueAction = new EnableInGroup(target, targetGroup);
				falseAction = new DisableInGroup(target, targetGroup);
				break;

			default:
				throw new SystemException("ControlAction type not valid");
		}

		// Create Condition
		Condition condition = createCondition();

		if (cbNot.isSelected()) {
			condition = new Not(condition);
		}

		// Create Rule
		Rule rule = new Rule(condition, trueAction, falseAction);

		// Create Subordinate
		WSubordinateControl control = new WSubordinateControl();
		control.addRule(rule);

		buildControlPanel.add(control);

		if (targetCollapsible.getDecoratedLabel() != null) {
			targetCollapsible.getDecoratedLabel().setTail(new WText(control.toString()));
		}

		control = new WSubordinateControl();
		rule = new Rule(new Equal(cbClientDisableTrigger, true), new Disable((SubordinateTarget) trigger), new Enable((SubordinateTarget) trigger));
		control.addRule(rule);
		buildControlPanel.add(control);
	}
950965
function() {
        OpenLayers.Control.prototype.draw.apply(this);

        // create layout divs
        this.loadContents();

        // set mode to minimize
        if(!this.outsideViewport) {
            this.minimizeControl();
        }

        // populate div with current info
        this.redraw();

        return this.div;
    }
944365
def add_to_toolbar(self, toolbar, widget):
        """"""
        actions = widget.toolbar_actions
        if actions is not None:
            add_actions(toolbar, actions)
849109
public function setControls()
	{
		$this->controls	= array();
		$args	= func_get_args();
		for( $i = 0; $i < $this->type; $i ++ )
			if( isset( $args[$i] ) )
				$this->controls[$i]	= $args[$i];
	}
256002
public void addScreenControls(Container parent)
    {
        GridBagConstraints c = this.getGBConstraints();
        c.weightx = 1.0;                        // Grow edit and scroll pane but not label
        c.anchor = GridBagConstraints.NORTHWEST;    // Edit boxes left justified
        c.gridx = 1;                            // Column 1
        c.gridy = GridBagConstraints.RELATIVE;  // Bump Row each time
        c.gridwidth = 3; // end column
        for (int iIndex = 0; ; iIndex++)
        {
            Converter converter = this.getFieldForScreen(iIndex);
            if (converter == SKIP_THIS_FIELD)
                continue;
            if (converter == null)
                break;
            this.addScreenControl(parent, converter);
        }
    }
1363328
public ToolScreen addToolbars()
    {
        ToolScreen screen = new ToolScreen(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null);
        new SCannedBox(screen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), screen, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.SUBMIT);
        new SCannedBox(screen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), screen, null, ScreenConstants.DEFAULT_DISPLAY, MenuConstants.RESET);
        String strDesc = "Create account";
        new SCannedBox(screen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), screen, null, ScreenConstants.DEFAULT_DISPLAY, null, strDesc, MenuConstants.FORM, MenuConstants.FORM, MenuConstants.FORM + "Tip");
        return screen;
    }
691246
function (settings) {
        var self = this;

        self._super(settings);

        if (self.isRtl()) {
          self.classes.add('rtl');
        }

        self.classes.add('window');
        self.bodyClasses.add('window-body');
        self.state.set('fixed', true);

        // Create statusbar
        if (settings.buttons) {
          self.statusbar = new Panel({
            layout: 'flex',
            border: '1 0 0 0',
            spacing: 3,
            padding: 10,
            align: 'center',
            pack: self.isRtl() ? 'start' : 'end',
            defaults: {
              type: 'button'
            },
            items: settings.buttons
          });

          self.statusbar.classes.add('foot');
          self.statusbar.parent(self);
        }

        self.on('click', function (e) {
          var closeClass = self.classPrefix + 'close';

          if (DomUtils.hasClass(e.target, closeClass) || DomUtils.hasClass(e.target.parentNode, closeClass)) {
            self.close();
          }
        });

        self.on('cancel', function () {
          self.close();
        });

        self.aria('describedby', self.describedBy || self._id + '-none');
        self.aria('label', settings.title);
        self._fullscreen = false;
      }
100906
function () {

/*Line 466 - 'AtomControl.js' */                this.onCreateChildren(this._element);

/*Line 468 - 'AtomControl.js' */                var t = this.getTemplate("template");

/*Line 470 - 'AtomControl.js' */                if (t) {
/*Line 471 - 'AtomControl.js' */                    var ce = new ChildEnumerator(this._element);
/*Line 472 - 'AtomControl.js' */                    // check if there is any children or not..
/*Line 473 - 'AtomControl.js' */                    if (!ce.next()) {
/*Line 474 - 'AtomControl.js' */                        if (t.constructor == String) {
/*Line 475 - 'AtomControl.js' */                            this._element.innerHTML = t;
/*Line 476 - 'AtomControl.js' */                            var caller = this;
/*Line 477 - 'AtomControl.js' */                            $(this._element).children().each(function () {
/*Line 478 - 'AtomControl.js' */                                this._templateParent = caller;
/*Line 479 - 'AtomControl.js' */                            });
/*Line 480 - 'AtomControl.js' */                        } else {
/*Line 481 - 'AtomControl.js' */                            //this._element.innerHTML = this._template;
/*Line 482 - 'AtomControl.js' */                            if (AtomUI.isNode(t)) {
/*Line 483 - 'AtomControl.js' */                                t = AtomUI.cloneNode(t);
/*Line 484 - 'AtomControl.js' */                                t._templateParent = this;
/*Line 485 - 'AtomControl.js' */                                this._element.appendChild(t);
/*Line 486 - 'AtomControl.js' */                            } else {
/*Line 487 - 'AtomControl.js' */                                // should be an array...
/*Line 488 - 'AtomControl.js' */                                var ae = new AtomEnumerator(t);
/*Line 489 - 'AtomControl.js' */                                while (ae.next()) {
/*Line 490 - 'AtomControl.js' */                                    var tc = ae.current();
/*Line 491 - 'AtomControl.js' */                                    tc = AtomUI.cloneNode(tc);
/*Line 492 - 'AtomControl.js' */                                    tc._templateParent = this;
/*Line 493 - 'AtomControl.js' */                                    this._element.appendChild(tc);
/*Line 494 - 'AtomControl.js' */                                }
/*Line 495 - 'AtomControl.js' */                            }
/*Line 496 - 'AtomControl.js' */                        }
/*Line 497 - 'AtomControl.js' */                        this.onCreateChildren(this._element);
/*Line 498 - 'AtomControl.js' */                    }
/*Line 499 - 'AtomControl.js' */                }
/*Line 500 - 'AtomControl.js' */            }
170309
public void addToToolbar( JComponent comp ) {
		toolbar.add(comp,1+algBoxes.length);
		toolbar.revalidate();
		addedComponents.add(comp);
	}
856837
public void addToolbarButtons(ToolScreen toolScreen)
    {
        new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, "Delete All", MenuConstants.DELETE, "Delete All", null);
    }