Configures instance properties, pointing to the
first and last focusable elements in the Dialog's form.

@method setFirstLastFocusable
164502
function() {

            Dialog.superclass.setFirstLastFocusable.call(this);

            var i, l, el, elements = this.focusableElements;

            this.firstFormElement = null;
            this.lastFormElement = null;

            if (this.form && elements && elements.length > 0) {
                l = elements.length;

                for (i = 0; i < l; ++i) {
                    el = elements[i];
                    if (this.form === el.form) {
                        this.firstFormElement = el;
                        break;
                    }
                }

                for (i = l-1; i >= 0; --i) {
                    el = elements[i];
                    if (this.form === el.form) {
                        this.lastFormElement = el;
                        break;
                    }
                }
            }
        }
939902
function(last) {
            var carousel    = this,
                numItems    = carousel.get("numItems"),
                numVisible  = carousel.get("numVisible"),
                reveal      = carousel.get("revealAmount"),
                first       = carousel._itemsTable.items.length,
                lastVisible = carousel.get("lastVisible");

            // adjust if going backwards
            if(first > last && last+1 >= numVisible){
                // need to get first a bit differently for the last page
                first = last % numVisible || last == lastVisible ? last - last % numVisible : last - numVisible + 1;
            }

            if(reveal && last < numItems - 1){ last++; }

            if (last >= first && (!carousel.getItem(first) || !carousel.getItem(last))) {
                carousel.fireEvent(loadItemsEvent, {
                        ev: loadItemsEvent, first: first, last: last,
                        num: last - first + 1
                });
            }

        }
1356487
function () {
                if (!_placeholderSupported && this._cfg.placeholder) {
                    var element = this._domElt;
                    if (element.value === "") {
                        element.value = this._cfg.placeholder;
                        var cssClass = new aria.utils.ClassList(element);
                        cssClass.add('placeholder');
                        cssClass.$dispose();
                        if (this._hasFocus) {
                            ariaUtilsCaret.setPosition(element, 0, 0);
                        }
                        this._hasPlaceholder = true;
                        this._domElt.unselectable = "on";
                    }
                }
            }
1165948
function () {
            var selected = [];
            var items = this._data.items;
            for (var i = 0; i < items.length; i++) {
                if (!items[i].initiallyDisabled) {
                    selected.push(items[i].value);
                }
            }
            this.setSelectedValues(selected);
            if (this._data) {
                this.json.setValue(this._data, "focusIndex", 0);
            }
        }
428405
function(){
			this._cursor = null;
			this._prevCursor = null;
			this.root = null;
			//By default the cursor is pointed to the first child 
			if(this.firstLevelChildren.length > 0){
				this._cursor = this.firstLevelChildren[0];
				this.root = this.firstLevelChildren[0].parent;
			}
		}
187019
@OverrideOnDemand
  protected void modifyFirstControlIfLabelIsPresent (@Nonnull final IHCElementWithChildren <?> aLabel,
                                                     @Nonnull final IHCControl <?> aFirstControl)
  {
    // Set the default placeholder (if none is present)
    if (aFirstControl instanceof IHCInput <?>)
    {
      final IHCInput <?> aEdit = (IHCInput <?>) aFirstControl;
      final EHCInputType eType = aEdit.getType ();
      if (eType != null && eType.hasPlaceholder () && !aEdit.hasPlaceholder ())
        aEdit.setPlaceholder (_getPlaceholderText (aLabel));
    }
    else
      if (aFirstControl instanceof IHCTextArea <?>)
      {
        final IHCTextArea <?> aTextArea = (IHCTextArea <?>) aFirstControl;
        if (!aTextArea.hasPlaceholder ())
          aTextArea.setPlaceholder (_getPlaceholderText (aLabel));
      }
  }
1155545
function (options) {
    this.focus = options['focus'] || null;
    this.selectedIndices = options['selectedIndices'] || null;
    this.rows = options['rows'] || []
    this.parent = options['parent'] || null;
}
1082866
def goto_last_item
      bc = @buttons.count
      f = nil
      @components[bc..-1].each { |c| 
        if c.focusable
          f = c
        end
      }
      if f
        leave_current_component
        @current_component = f
        set_form_row
      end
    end
1315651
private function _updateFirstLastKeys()
    {
        end($this->_storage);
        $this->_lastKey = key($this->_storage);
        reset($this->_storage);
        $this->_firstKey = key($this->_storage);

        $this->_modified = false;
    }
270086
function () {
            var min = this.options.min,
                max = this.options.max,
                from = this.options.from,
                to = this.options.to;

            if (from > min && to === max) {
                this.$cache.s_from.addClass("type_last");
            } else if (to < max) {
                this.$cache.s_to.addClass("type_last");
            }
        }
1368434
function focusOnOpen() {
        if (options.focusOnOpen) {
          var target = $mdUtil.findFocusTarget(element) || findCloseButton() || dialogElement;
          target.focus();
        }

        /**
         * If no element with class dialog-close, try to find the last
         * button child in md-actions and assume it is a close button.
         *
         * If we find no actions at all, log a warning to the console.
         */
        function findCloseButton() {
          return element[0].querySelector('.dialog-close, md-dialog-actions button:last-child');
        }
      }
899756
function anchorFirst() {
    self.startRow = anchorRow;
    self.startNode = selection.anchorNode;
    self.startOffset = selection.anchorOffset;
    self.endRow = focusRow;
    self.endNode = selection.focusNode;
    self.endOffset = selection.focusOffset;
  }
887354
function (type, args, obj) {

            var aButtons = this.cfg.getProperty("buttons"),
                el = this.lastFormElement;

            if (args && args[1]) {
                Event.stopEvent(args[1]);
            }

            if (aButtons && Lang.isArray(aButtons)) {
                this.focusLastButton();
            } else {
                if (el) {
                    try {
                        el.focus();
                    } catch(oException) {
                        // Ignore
                    }
                }
            }
        }
159775
def select_first_field
      # this results in on_leave of last field being executed when form starts.
      #@active_index = -1 # FIXME HACK
      #select_next_field
      ix =  @focusables.first
      return unless ix # no focussable field

      # if the user is on a field other than current then fire on_leave
      if @active_index.nil? || @active_index < 0
      elsif @active_index != ix
        f = @widgets[@active_index]
        begin
          #$log.debug " select first field, calling on_leave of #{f} #{@active_index} "
          on_leave f
        rescue => err
         $log.error " Caught EXCEPTION select_first_field on_leave #{err}"
         Ncurses.beep
         #$error_message = "#{err}"
         $error_message.value = "#{err}"
         return
        end
      end
      select_field ix
    end
907620
private void setEnabledButtons() {
        int currentStep = getCurrentStep();
        if(currentStep < 0) {
           return;
        }
        
        boolean isPreviousEnabled = true;
        boolean isNextEnabled = true;
        
        if(getNextStep(currentStep) < 0 && currentStep != STEP_THANKS) {
            isNextEnabled = false;
        }

         if(getPreviousStep(currentStep) < 0) {
            isPreviousEnabled = false;
        }

        setIsControlEnable(previousButtonName, isPreviousEnabled);
        setIsControlEnable(nextButtonName, isNextEnabled);

        if(currentStep == STEP_OMISSIONS) {
            setControlText(nextButtonName, I18nLabelsLoader.REPORT_STEP_BUTTONS_SUBMIT);
            if(theCommunityLogic.hasBadInterventions() || theCommunityLogic.hasOmissions()) {
                setIsControlEnable(nextButtonName, true);
            } else {
                 setIsControlEnable(nextButtonName, false);
            }
            
        } else if (currentStep == STEP_THANKS) {
            setControlText(nextButtonName, I18nLabelsLoader.REPORT_STEP_BUTTONS_FINISH);
        } else {
            setControlText(nextButtonName, I18nLabelsLoader.REPORT_STEP_BUTTONS_NEXT);
        }

    }
769343
function() {

          if (common.isUndefined(SAVE_DIALOGUE)) {
            SAVE_DIALOGUE = new CenteredDiv();
            SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;
          }

          if (this.parent) {
            throw new Error("You can only call remember on a top level GUI.");
          }

          var _this = this;

          common.each(Array.prototype.slice.call(arguments), function(object) {
            if (_this.__rememberedObjects.length == 0) {
              addSaveMenu(_this);
            }
            if (_this.__rememberedObjects.indexOf(object) == -1) {
              _this.__rememberedObjects.push(object);
            }
          });

          if (this.autoPlace) {
            // Set save row width
            setWidth(this, this.width);
          }

        }
632776
function () {
            var selected;
            if (this.isPlaceholderOptionSelected()) {
                this.updateSelection(null);
                this.close();
                this.setPlaceholder();
            } else {
                var self = this;
                this.opts.initSelection.call(null, this.opts.element, function(selected){
                    if (selected !== undefined && selected !== null) {
                        self.updateSelection(selected);
                        self.close();
                        self.setPlaceholder();
                        self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
                    }
                });
            }
        }