/* (non-PHPdoc)
@see \rocket\ei\manage\gui\GuiField::createUiComponent()
173949
public function createUiComponent(HtmlView $view,
			Eiu $eiu) {
		return $view->getHtmlBuilder()->getEsc(
				implode(self::OUTPUT_SEPARATOR, (array)$eiEntry->getValue(EiPropPath::from($this))));
	}
1015441
public function createComponentFilter()
	{
		$form = new Form($this, 'filter');

		$form->setMethod(static::$form_method);

		$form->setTranslator($this->getTranslator());

		/**
		 * InlineEdit part
		 */
		$inline_edit_container = $form->addContainer('inline_edit');

		if ($this->inlineEdit instanceof InlineEdit) {
			$inline_edit_container->addSubmit('submit', 'ublaboo_datagrid.save')
				->setValidationScope([$inline_edit_container]);
			$inline_edit_container->addSubmit('cancel', 'ublaboo_datagrid.cancel')
				->setValidationScope(false);

			$this->inlineEdit->onControlAdd($inline_edit_container);
			$this->inlineEdit->onControlAfterAdd($inline_edit_container);
		}

		/**
		 * InlineAdd part
		 */
		$inline_add_container = $form->addContainer('inline_add');

		if ($this->inlineAdd instanceof InlineEdit) {
			$inline_add_container->addSubmit('submit', 'ublaboo_datagrid.save')
				->setValidationScope([$inline_add_container]);
			$inline_add_container->addSubmit('cancel', 'ublaboo_datagrid.cancel')
				->setValidationScope(false)
				->setAttribute('data-datagrid-cancel-inline-add', true);

			$this->inlineAdd->onControlAdd($inline_add_container);
			$this->inlineAdd->onControlAfterAdd($inline_add_container);
		}

		/**
		 * ItemDetail form part
		 */
		$items_detail_form = $this->getItemDetailForm();

		if ($items_detail_form instanceof Nette\Forms\Container) {
			$form['items_detail_form'] = $items_detail_form;
		}

		/**
		 * Filter part
		 */
		$filter_container = $form->addContainer('filter');

		foreach ($this->filters as $filter) {
			$filter->addToFormContainer($filter_container);
		}

		if (!$this->hasAutoSubmit()) {
			$filter_container['submit'] = $this->getFilterSubmitButton();
		}

		/**
		 * Group action part
		 */
		$group_action_container = $form->addContainer('group_action');

		if ($this->hasGroupActions()) {
			$this->getGroupActionCollection()->addToFormContainer($group_action_container);
		}

		if (!$form->isSubmitted()) {
			$this->setFilterContainerDefaults($form['filter'], $this->filter);
		}

		/**
		 * Per page part
		 */
		$form->addSelect('per_page', '', $this->getItemsPerPageList())
			->setTranslator(null);

		if (!$form->isSubmitted()) {
			$form['per_page']->setValue($this->getPerPage());
		}

		$form->addSubmit('per_page_submit', 'ublaboo_datagrid.per_page_submit')
			->setValidationScope([$form['per_page']]);

		$form->onSubmit[] = [$this, 'filterSucceeded'];
	}
210790
private void buildUI() {
		// build the configuration options UI.
		WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
		layout.setMargin(new Margin(null, null, Size.LARGE, null));
		add(layout);
		layout.addField("Autoplay", cbAutoPlay);
		layout.addField("Loop", cbLoop);
		layout.addField("Disable", cbDisable);
		layout.addField("Show only play/pause", cbControls);
		layout.addField((WLabel) null, btnApply);

		// enable disable option only when control PLAY_PAUSE is used.
		WSubordinateControl control = new WSubordinateControl();
		add(control);
		Rule rule = new Rule();
		rule.setCondition(new Equal(cbControls, Boolean.TRUE.toString()));
		rule.addActionOnTrue(new Enable(cbDisable));
		rule.addActionOnFalse(new Disable(cbDisable));
		control.addRule(rule);

		// allow config to change without reloading the whole page.
		add(new WAjaxControl(btnApply, audio));

		// add the audio to the UI
		add(audio);
	}
1113070
public function buildGuiField(Eiu $eiu): ?GuiField {
		$mapping = $eiu->entry()->getEiEntry();
	
		$eiFrame = $eiu->frame()->getEiFrame();
		$relationEiField = $mapping->getEiField(EiPropPath::from($this));
		try {
			$targetReadEiFrame = $this->eiPropRelation->createTargetReadPseudoEiFrame($eiFrame, $mapping);
		} catch (InaccessibleEiCommandPathException $e) {
			return null;
		}
		
		$panelConfigs = $this->determinePanelConfigs($eiu);
	
		$contentItemEditable = null;
		if (!$this->eiPropRelation->isReadOnly($mapping, $eiFrame)) {
			$targetEditEiFrame = $this->eiPropRelation->createTargetEditPseudoEiFrame($eiFrame, $mapping);
				
			$contentItemEditable = new ContentItemEditable($this->getLabelLstr(), $relationEiField, $targetReadEiFrame,
					$targetEditEiFrame, $panelConfigs);
			
			$draftMode = $mapping->getEiObject()->isDraft();
			$contentItemEditable->setDraftMode($draftMode);
			$contentItemEditable->setReduced($this->isReduced());
				
			if ($targetEditEiFrame->getEiExecution()->isGranted()) {
				$contentItemEditable->setNewMappingFormUrl($this->eiPropRelation->buildTargetNewEiuEntryFormUrl($mapping,
						$draftMode, $eiFrame, $eiu->frame()->getHttpContext()));
			}
		}
		
		return new ContentItemGuiField($this->getLabelLstr(), $this->determinePanelConfigs($eiu), 
				$relationEiField, $targetReadEiFrame, $eiu->gui()->isCompact(), $contentItemEditable);
	}
132777
function init_ui()
    {
        if ($this->ui_initialized) {
            return;
        }

        // load localization
        $this->add_texts('localization/');

        $sieve_action = strpos($this->rc->action, 'plugin.managesieve') === 0;

        if ($this->rc->task == 'mail' || $sieve_action) {
            $this->include_script('managesieve.js');
        }

        // include styles
        $skin_path = $this->local_skin_path();
        if ($sieve_action || ($this->rc->task == 'settings' && empty($_REQUEST['_framed']))) {
            $this->include_stylesheet("$skin_path/managesieve.css");
        }
        else if ($this->rc->task == 'mail') {
            $this->include_stylesheet("$skin_path/managesieve_mail.css");
        }

        $this->ui_initialized = true;
    }
102519
private static <T> T createCustomComponent(Class<T> componentType, String componentSpec,
            Map<String, String> configProperties, IPluginRegistry pluginRegistry) throws Exception {
        return createCustomComponent(componentType, componentSpec, configProperties, pluginRegistry, null);
    }
1124711
public UIComponent createComponent(FacesContext context, Resource componentResource)
    {
        Application application = getMyfacesApplicationInstance(context);
        if (application != null)
        {
            return application.createComponent(context, componentResource);
        }
        throw new UnsupportedOperationException();
    }
954452
public JComponent createScreenComponent(Converter fieldInfo)
    {
        int iRows = 1;
        int iColumns = fieldInfo.getMaxLength();
        if (iColumns > 40)
        {
            iRows = 3;
            iColumns = 30;
        }
        String strDefault = fieldInfo.toString();
        if (strDefault == null)
            strDefault = Constants.BLANK;

        JComponent component = null;
        if (iRows <= 1)
        {
            component = new JTextField(strDefault, iColumns);
            if (fieldInfo instanceof FieldInfo)
                if (Number.class.isAssignableFrom(((FieldInfo)fieldInfo).getDataClass()))
                    ((JTextField)component).setHorizontalAlignment(JTextField.RIGHT);
        }
        else
        {
            component = new JTextArea(strDefault, iRows, iColumns);
            component.setBorder(m_borderLine);
        }
        return component;
    }
387403
private void createExampleUi() {
		add(new WHeading(HeadingLevel.H2, "Contacts"));

		add(repeater);
		WButton addBtn = new WButton("Add");
		addBtn.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				addNewContact();
			}
		});
		newNameField.setDefaultSubmitButton(addBtn);

		WButton printBtn = new WButton("Print");
		printBtn.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				printEditedDetails();
			}
		});

		WFieldLayout layout = new WFieldLayout();
		add(layout);
		layout.addField("New contact name", newNameField);
		layout.addField((WLabel) null, addBtn);
		layout.addField("Print output", console);
		layout.addField((WLabel) null, printBtn);

		// Ajax controls to make things zippier
		add(new WAjaxControl(addBtn, new AjaxTarget[]{repeater, newNameField}));
		add(new WAjaxControl(printBtn, console));
	}
7951
public function create($model, string $column): Component
    {
        if (!isset($this->panelElementTypes[$model->type])) {
            throw ComponentNotFound::forModel($model);
        }

        $className = $this->panelElementTypes[$model->type];

        return new $className(
            $model,
            $this->templateEngine,
            $this->colorRotate,
            $this->scopeMatcher,
            $column
        );
    }
1152601
public function createUiField(PropertyPath $propertyPath, HtmlView $view, UiOutfitter $uiOutfitter): UiComponent {
		$ciEiTypeLabels = array();
		
		$targetContextEiMask = $this->targetEditEiFrame->getContextEiEngine()->getEiMask();
		foreach ($this->targetEditEiFrame->getContextEiEngine()->getEiMask()->getEiType()->getAllSubEiTypes() as $subEiType) {
			if ($subEiType->isAbstract()) continue;
			
			$ciEiTypeLabels[$subEiType->getId()] = $this->targetEditEiFrame->determineEiMask($subEiType)->getLabelLstr()
					->t($view->getN2nLocale());
		}
		
		return $view->getImport('\rocket\impl\ei\component\prop\ci\view\contentItemsForm.html',
				array('panelLayout' => new PanelLayout($this->panelConfigs), 'propertyPath' => $propertyPath,
						'ciEiTypeLabels' => $ciEiTypeLabels));
	}
51403
private void buildUI() {
		buildTargetPanel();
		buildConfigOptions();
		add(new WHorizontalRule());
		add(panel);
		add(new WHorizontalRule());

		// We need this reflection of the selected menu item just so we can reuse the menu from the
		// MenuBarExample. It serves no purpose in this example so I am going to hide it.
		WPanel hiddenPanel = new WPanel() {
			@Override
			public boolean isHidden() {
				return true;
			}
		};
		hiddenPanel.add(selectedMenuText);
		add(hiddenPanel);
		add(new WAjaxControl(applyConfigButton, panel));
		buildSubordinates();
	}
1276804
function createInternalComponent(element) {
  !genericComponentClass ?  false ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
  return new genericComponentClass(element);
}
1020474
private static void decorateComponent(UIComponent parent, UIComponent comp, FacesContext ctx, ResponseWriter rw)
			throws IOException {
		if (comp instanceof Icon)
			((Icon) comp).setAddon(true); // modifies the id of the icon

		String classToApply = "input-group-addon";
		if (comp.getClass().getName().endsWith("Button") || comp.getChildCount() > 0)
			classToApply = "input-group-btn";

		if (comp instanceof HtmlOutputText) {
			HtmlOutputText out = (HtmlOutputText)comp;
			
			String sc = out.getStyleClass();
			if (sc == null)
				sc = classToApply;
			else
				sc = sc + " " + classToApply;
			out.setStyleClass(sc);
			comp.encodeAll(ctx);
		}
		else {
			rw.startElement("span", parent);
			rw.writeAttribute("class", classToApply, "class");
			comp.encodeAll(ctx);
		 rw.endElement("span");
		}
	}
371057
private void buildUI() {
		add(messages);
		add(tabset);
		// add(new AccessibilityWarningContainer());

		container.add(new WText("Select an example from the menu"));
		// Set a static ID on container and it becomes a de-facto naming context.
		container.setIdName("eg");
		tabset.addTab(container, "(no selection)", WTabSet.TAB_MODE_CLIENT);

		WImage srcImage = new WImage(new ImageResource("/image/text-x-source.png", "View Source"));
		srcImage.setCacheKey("srcTabImage");
		tabset.addTab(source, new WDecoratedLabel(srcImage), WTabSet.TAB_MODE_LAZY).setToolTip("View Source");

		// The refresh current view button.
		WButton refreshButton = new WButton("\u200b");
		refreshButton.setToolTip("Refresh");
		refreshButton.setHtmlClass(HtmlIconUtil.getIconClasses("fa-refresh"));
		//refreshButton.setImage("/image/refresh-w.png");
		refreshButton.setRenderAsLink(true);
		refreshButton.setAction(new ValidatingAction(messages.getValidationErrors(), refreshButton) {
			@Override
			public void executeOnValid(final ActionEvent event) {
				// Do Nothing
			}
		});

		// The reset example button.
		final WButton resetButton = new WButton("\u200b");
		resetButton.setToolTip("Reset");
		resetButton.setHtmlClass(HtmlIconUtil.getIconClasses("fa-times-circle"));
		//resetButton.setImage("/image/cancel-w.png");
		resetButton.setRenderAsLink(true);
		resetButton.setAction(new ValidatingAction(messages.getValidationErrors(), resetButton) {
			@Override
			public void executeOnValid(final ActionEvent event) {
				resetExample();
			}
		});

		addToTail(refreshButton);
		addToTail(new WText("\u2002"));
		addToTail(resetButton);
	}
1205228
public function createUiField(PropertyPath $propertyPath, HtmlView $view, UiOutfitter $uiOutfitter): UiComponent {
		return $view->getImport('\rocket\impl\ei\component\prop\relation\view\toManyForm.html',
				array('selectOverviewToolsUrl' => $this->selectOverviewToolsUrl, 
						'newMappingFormUrl' => $this->newMappingFormUrl, 'propertyPath' => $propertyPath));
	}
971825
function createComponent( &$xcaldecl ) {
    $objectname = $this->_createFormat();
    $component  = $this->componentStart1.$objectname.$this->componentStart2.$this->nl;
    $component .= $this->createUid();
    $component .= $this->createDtstamp();
    $component .= $this->createAttendee();
    $component .= $this->createComment();
    $component .= $this->createContact();
    $component .= $this->createDtend();
    $component .= $this->createDtstart();
    $component .= $this->createDuration();
    $component .= $this->createFreebusy();
    $component .= $this->createOrganizer();
    $component .= $this->createRequestStatus();
    $component .= $this->createUrl();
    $component .= $this->createXprop();
    $component .= $this->componentEnd1.$objectname.$this->componentEnd2;
    if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) {
      foreach( $this->xcaldecl as $localxcaldecl )
        $xcaldecl[] = $localxcaldecl;
    }
    return $component;
  }