/*
Add a 'node select' field which provides a button for showing a Node Select Dialog and a
non editable field for showing the node selected
355478
public void addNodeSelectField(final String fieldLabel, final SiteNode value, 
			final boolean editable, final boolean allowRoot) {
		validateNotTabbed();
		final ZapTextField text = new ZapTextField();
		text.setEditable(editable);
		if (value != null) {
			text.setText(getNodeText(value));
		}
		JButton selectButton = new JButton(Constant.messages.getString("all.button.select"));
		selectButton.setIcon(new ImageIcon(View.class.getResource("/resource/icon/16/094.png"))); // Globe icon
		selectButton.addActionListener(new java.awt.event.ActionListener() { 
			// Keep a local copy so that we can always select the last node chosen
			SiteNode node = value;
			@Override
			public void actionPerformed(java.awt.event.ActionEvent e) {
				NodeSelectDialog nsd = new NodeSelectDialog(StandardFieldsDialog.this);
				nsd.setAllowRoot(allowRoot);
				SiteNode node = nsd.showDialog(this.node);
				if (node != null) {
					text.setText(getNodeText(node));
					this.node = node;
					siteNodeSelected(fieldLabel, node);
				}
			}
		});
		JPanel panel = new JPanel();
		panel.setLayout(new GridBagLayout());
		panel.add(text, LayoutHelper.getGBC(0, 0, 1, 1.0D, 0.0D, GridBagConstraints.BOTH, new Insets(4,4,4,4)));
		panel.add(selectButton, LayoutHelper.getGBC(1, 0, 1, 0.0D, 0.0D, GridBagConstraints.BOTH, new Insets(4,4,4,4)));
		
		this.addField(fieldLabel, text, panel, 0.0D);
	}
1135983
function( id, label, fieldProps )
	{
		return {
			type : 'hbox',
			padding : 0,
			widths : [ '60%', '40%' ],
			children : [
				CKEDITOR.tools.extend( {
					type : 'text',
					id : id,
					label : lang[ label ]
				}, fieldProps || {}, 1 ),
				{
					type : 'button',
					id : id + 'Choose',
					label : lang.chooseColor,
					className : 'colorChooser',
					onClick : function()
					{
						var self = this;
						getDialogValue( 'colordialog', function( colorDialog )
						{
							var dialog = self.getDialog();
							dialog.getContentElement( dialog._.currentTabId, id ).setValue( colorDialog.getContentElement( 'picker', 'selectedColor' ).getValue() );
						});
					}
				}
			]
		};
	}
899979
@UiHandler("m_selectButton")
    public void onSelectClick(ClickEvent event) {

        if (m_galleryMode == GalleryMode.editor) {
            // note: the select button isn't necessarily visible in editor mode (depending on the WYSIWYG editor), but
            // if it is, we want it to save the data and close the gallery dialog
            if (getHandler().setDataInEditor()) {
                // do this after a delay, so we don't get ugly Javascript errors when the iframe is closed.
                Timer timer = new Timer() {

                    @Override
                    public void run() {

                        CmsPreviewUtil.closeDialog();
                    }

                };
                timer.schedule(1);
            }
        } else {
            saveChanges(null);
            getHandler().selectResource();
        }
    }
1206588
function(node) {
            var instance = this,
                pjaxselectionCont = Y.one('.pjaxselection'),
                pjaxselectionButtons = pjaxselectionCont.all('button');

            pjaxselectionCont.delegate(
                'click',
                function(e) {
                    var btn = e.currentTarget,
                        pjaxtype;
                    pjaxselectionButtons.removeClass(PURE_BUTTON_ACTIVE);
                    btn.addClass(PURE_BUTTON_ACTIVE);
                    pjaxtype = btn.getAttribute('data-pjaxtype');
                    switch (pjaxtype) {
                        case '0':
                            instance.switchAttribute(false);
                        break;
                        case '1':
                            instance.switchAttribute(true);
                            instance.allAnchor.removeAttribute('data-pjax-cache');
                        break;
                        case '2':
                            instance.switchAttribute(true);
                            instance.allAnchor.setAttribute('data-pjax-cache', true);
                        break;
                    }
                    Y.soon(Y.bind(instance.refreshCodedescription, instance));
                },
                'button'
            );
        }
676372
function Node (options) {
    options = options || {}
    this._contentSize = options.contentSize || new geo.Size(0, 0)
    this._anchorPoint = options.anchorPoint || ccp(0.0, 0.0)
    this._updateAnchorPointInPixels() // Sets this.anchorPointInPixels
    this._position = options.position || ccp(0, 0)
    this.children = []

    events.addListener(this, 'dirtytransform', this._dirtyTransform.bind(this))
}
1218416
private void addListCollectorEditorButtons(Element editable) {

        CmsListCollectorEditor editor = new CmsListCollectorEditor(editable, m_clientId);
        add(editor, editable.getParentElement());
        if (CmsDomUtil.hasDimension(editable.getParentElement())) {
            editor.setParentHasDimensions(true);
            editor.setPosition(CmsDomUtil.getEditablePosition(editable), getElement());
        } else {
            editor.setParentHasDimensions(false);
        }
        m_editables.put(editable, editor);
    }
96640
public function addSelectable($field)
    {
        $this->js_widget = null;
        $this->js(true)
            ->_load('ui.atk4_checkboxes')
            ->atk4_checkboxes(array('dst_field' => $field));
        $this->addColumn('checkbox', 'selected');

        $this->addOrder()
            ->useArray($this->columns)
            ->move('selected', 'first')
            ->now();
    }
429829
function() {
      
      this.editorContainer = inputEx.cn('div', {className: CSS_PREFIX+'editor'}, {display: 'none'});
      
      //  field
      this.editorField = inputEx(this.options.editorField,this);
      var editorFieldEl = this.editorField.getEl();
      
      this.editorContainer.appendChild( editorFieldEl );
      Dom.addClass( editorFieldEl , CSS_PREFIX+'editorDiv');
      
      this.okButton = new inputEx.widget.Button({
         type: this.options.buttonTypes.ok,
         parentEl: this.editorContainer,
         value: inputEx.messages.okEditor,
         className: "inputEx-Button "+CSS_PREFIX+'OkButton',
         onClick: {fn: this.onOkEditor, scope:this}
      });

      this.cancelLink = new inputEx.widget.Button({
         type: this.options.buttonTypes.cancel,
         parentEl: this.editorContainer,
         value: inputEx.messages.cancelEditor,
         className: "inputEx-Button "+CSS_PREFIX+'CancelLink',
         onClick: {fn: this.onCancelEditor, scope:this}
      });
      
      // Line breaker ()
      this.editorContainer.appendChild( inputEx.cn('div',null, {clear: 'both'}) );
      
      this.fieldContainer.appendChild(this.editorContainer);
      
   }
527225
function SettingsSelect( params, node ){
		makeLocalSelect(params);
		Select.apply(this, arguments);
		this.mylabel = lib.$(".setting-label", this.node); //$NON-NLS-0$
	}
1373828
function addText() {

  // Add title
  dialogEl.querySelector( '#dialog-title' ).innerHTML = options.title

  // Add optional description
  var descriptionEl = dialogEl.querySelector( '#dialog-description' )

  if ( options.description ) {
    descriptionEl.innerHTML = options.description
  } else {
    descriptionEl.parentElement.removeChild( descriptionEl )
    dialogEl.removeAttribute( 'aria-labelledby' )
  }

}
825191
void toggleSelectOU() {

        boolean create = m_fieldCreateOU.getValue().booleanValue();

        m_fieldSelectOU.setEnabled(!create);
        m_fieldSelectParentOU.setEnabled(create);
        m_fieldSelectOU.select("/");
    }
642470
function SelectionField(type, options) {
  Field.call(this, type, options);

  this.arg = new Argument();

  this.menu = new Menu({
    document: this.document,
    maxPredictions: Conversion.maxPredictions
  });
  this.element = this.menu.element;

  this.onFieldChange = util.createEvent('SelectionField.onFieldChange');

  // i.e. Register this.onItemClick as the default action for a menu click
  this.menu.onItemClick.add(this.itemClicked, this);
}
1307186
function FormSelect(el, options) {
      _classCallCheck(this, FormSelect);

      // Don't init if browser default version
      var _this68 = _possibleConstructorReturn(this, (FormSelect.__proto__ || Object.getPrototypeOf(FormSelect)).call(this, FormSelect, el, options));

      if (_this68.$el.hasClass('browser-default')) {
        return _possibleConstructorReturn(_this68);
      }

      _this68.el.M_FormSelect = _this68;

      /**
       * Options for the select
       * @member FormSelect#options
       */
      _this68.options = $.extend({}, FormSelect.defaults, options);

      _this68.isMultiple = _this68.$el.prop('multiple');

      // Setup
      _this68.el.tabIndex = -1;
      _this68._keysSelected = {};
      _this68._valueDict = {}; // Maps key to original and generated option element.
      _this68._setupDropdown();

      _this68._setupEventHandlers();
      return _this68;
    }
404139
function(e, oSelf) {
    var sMode = oSelf.get("selectionMode");

    if(sMode == "standard") {
        oSelf._handleStandardSelectionByKey(e);
    }
    else if(sMode == "single") {
        oSelf._handleSingleSelectionByKey(e);
    }
    else if(sMode == "cellblock") {
        oSelf._handleCellBlockSelectionByKey(e);
    }
    else if(sMode == "cellrange") {
        oSelf._handleCellRangeSelectionByKey(e);
    }
    else if(sMode == "singlecell") {
        oSelf._handleSingleCellSelectionByKey(e);
    }
    
    if(oSelf._oCellEditor) {
        if(oSelf._oCellEditor.fireEvent) {
            oSelf._oCellEditor.fireEvent("blurEvent", {editor: oSelf._oCellEditor});
        }
        else if(oSelf._oCellEditor.isActive) {
            oSelf.fireEvent("editorBlurEvent", {editor:oSelf._oCellEditor});
        }
    }

    var elTarget = Ev.getTarget(e);
    var elTag = elTarget.nodeName.toLowerCase();
    var bKeepBubbling = true;
    while(elTarget && (elTag != "table")) {
        switch(elTag) {
            case "body":
                return;
            case "tbody":
                bKeepBubbling = oSelf.fireEvent("tbodyKeyEvent",{target:elTarget,event:e});
                break;
            default:
                break;
        }
        if(bKeepBubbling === false) {
            return;
        }
        else {
            elTarget = elTarget.parentNode;
            if(elTarget) {
                elTag = elTarget.nodeName.toLowerCase();
            }
        }
    }
    oSelf.fireEvent("tableKeyEvent",{target:(elTarget || oSelf._elContainer),event:e});
}
1312736
function(ctx) {
		// TODO: return promise?
		if( ctx.targetType === "title" && ctx.options.clickFolderMode === 4) {
//			this.nodeSetFocus(ctx);
//			this._callHook("nodeSetActive", ctx, true);
			this._callHook("nodeToggleExpanded", ctx);
		}
		// TODO: prevent text selection on dblclicks
		if( ctx.targetType === "title" ) {
			ctx.originalEvent.preventDefault();
		}
	}
651584
function( command, param, force_selection )
        {
            // give selection to contenteditable element
            restoreSelection( node_contenteditable, popup_saved_selection );
            // tried to avoid forcing focus(), but ... - https://github.com/wysiwygjs/wysiwyg.js/issues/51
            node_contenteditable.focus();
            if( ! selectionInside(node_contenteditable, force_selection) ) // returns 'selection inside editor'
                return false;

            // Buggy, call within 'try/catch'
            try {
                if( document.queryCommandSupported && ! document.queryCommandSupported(command) )
                    return false;
                return document.execCommand( command, false, param );
            }
            catch( e ) {
            }
            return false;
        }
1236998
function(_value,_node){
            // for multiple select
            if (!!_node.multiple){
                var _map;
                if (!_u._$isArray(_value)){
                    _map[_value] = _value;
                }else{
                    _map = _u._$array2object(_value);
                }
                _u._$forEach(
                    _node.options,function(_option){
                        _option.selected = _map[_option.value]!=null;
                    }
                );
            }else{
                _node.value = _getValue(_value);
            }
        }