Paint the response for the file uploaded in this request.

@param widget the file widget to render
@param xml the XML string builder
@param uploadId the file id uploaded in this request
519387
protected void handleFileUploadRequest(final WMultiFileWidget widget, final XmlStringBuilder xml, final String uploadId) {

		FileWidgetUpload file = widget.getFile(uploadId);
		if (file == null) {
			throw new SystemException("Invalid file id [" + uploadId + "] to render uploaded response.");
		}
		int idx = widget.getFiles().indexOf(file);
		FileWidgetRendererUtil.renderFileElement(widget, xml, file, idx);
	}
261533
public static synchronized void stopUpload(final String uploadId) {
        UploadTask removedTask = uploadTasksMap.get(uploadId);
        if (removedTask != null) {
            removedTask.cancel();
        }
    }
594913
public void addFile(final FileWidgetUpload file) {
		List<FileWidgetUpload> files = (List<FileWidgetUpload>) getData();
		if (files == null) {
			files = new ArrayList<>();
			setData(files);
		}
		files.add(file);
		MemoryUtil.checkSize(files.size(), this.getClass().getSimpleName());
	}
524830
public static void put(String key, WidgetBuilder builder) {
		if (null != key && null != builder) {
			WIDGETBUILDERS.put(key, builder);
		}
	}
675156
private CmsUploadButton createImageUploadButton(
        String label,
        Resource icon,
        CmsUser user,
        I_UploadListener uploadListener) {

        CmsUploadButton uploadButton = new CmsUploadButton(
            CmsUserIconHelper.USER_IMAGE_FOLDER + CmsUserIconHelper.TEMP_FOLDER);
        if (label != null) {
            uploadButton.setCaption(label);
        }
        if (icon != null) {
            uploadButton.setIcon(icon);
        }
        uploadButton.getState().setUploadType(UploadType.singlefile);
        uploadButton.getState().setTargetFileNamePrefix(user.getId().toString());
        uploadButton.getState().setDialogTitle(
            CmsVaadinUtils.getMessageText(Messages.GUI_USER_INFO_UPLOAD_IMAGE_DIALOG_TITLE_0));
        uploadButton.addUploadListener(uploadListener);
        return uploadButton;

    }
1260796
function(id, fileInput) {
                super_.add(id, {input: fileInput});

                fileInput.setAttribute("name", inputName);

                // remove file input from DOM
                if (fileInput.parentNode) {
                    qq(fileInput).remove();
                }
            }
222425
private void paintAjax(final WRadioButtonSelect rbSelect, final XmlStringBuilder xml) {
		// Start tag
		xml.appendTagOpen("ui:ajaxtrigger");
		xml.appendAttribute("triggerId", rbSelect.getId());
		xml.appendClose();

		// Target
		xml.appendTagOpen("ui:ajaxtargetid");
		xml.appendAttribute("targetId", rbSelect.getAjaxTarget().getId());
		xml.appendEnd();

		// End tag
		xml.appendEndTag("ui:ajaxtrigger");
	}
769881
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WImage imageComponent = (WImage) component;
		XmlStringBuilder xml = renderContext.getWriter();

		// No image set
		if (imageComponent.getImage() == null && imageComponent.getImageUrl() == null) {
			return;
		}

		renderTagOpen(imageComponent, xml);
		xml.appendEnd();
	}
584667
public static void displayAction(
        CmsContainerElementBean element,
        I_CmsFormatterBean formatter,
        PageContext context,
        ServletRequest request,
        ServletResponse response) {

        displayAction(element, formatter, false, false, false, null, null, context, request, response);
    }
444171
private void paintAction(final Action action, final String elementName,
			final XmlStringBuilder xml) {
		switch (action.getActionType()) {
			case SHOW:
			case HIDE:
			case ENABLE:
			case DISABLE:
			case OPTIONAL:
			case MANDATORY:
				paintStandardAction(action, elementName, xml);
				break;

			case SHOWIN:
			case HIDEIN:
			case ENABLEIN:
			case DISABLEIN:
				paintInGroupAction(action, elementName, xml);
				break;

			default:
				break;
		}
	}
170978
protected void doHandleFileAjaxActionRequest(final Request request) {
		// Protect against client-side tampering of disabled components
		if (isDisabled()) {
			throw new SystemException("File widget is disabled.");
		}

		// Check for file id
		String fileId = request.getParameter(FILE_UPLOAD_ID_KEY);
		if (fileId == null) {
			throw new SystemException("No file id provided for ajax action.");
		}

		// Check valid file id
		FileWidgetUpload file = getFile(fileId);
		if (file == null) {
			throw new SystemException("Invalid file id [" + fileId + "].");
		}

		// Run the action
		final Action action = getFileAjaxAction();
		if (action == null) {
			throw new SystemException("No action set for file ajax action request.");
		}

		// Set the selected file id as the action object
		final ActionEvent event = new ActionEvent(this, "fileajax", fileId);
		Runnable later = new Runnable() {
			@Override
			public void run() {
				action.execute(event);
			}
		};

		invokeLater(later);
	}
350048
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WImageEditor editorComponent = (WImageEditor) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("wc-imageedit");
		xml.appendAttribute("id", editorComponent.getId());
		xml.appendOptionalAttribute("class", editorComponent.getHtmlClass());
		xml.appendOptionalUrlAttribute("overlay", editorComponent.getOverlayUrl());
		xml.appendOptionalAttribute("camera", editorComponent.getUseCamera());
		xml.appendOptionalAttribute("face", editorComponent.getIsFace());
		xml.appendOptionalAttribute("inline", editorComponent.getRenderInline());

		// Check for size information on the image
		Dimension size = editorComponent.getSize();
		if (size != null) {
			if (size.getHeight() >= 0) {
				xml.appendAttribute("height", size.height);
			}

			if (size.getWidth() >= 0) {
				xml.appendAttribute("width", size.width);
			}
		}

		xml.appendEnd();
	}
251725
public void showElement(CmsContainerPageElementPanel elementWidget) {

        int index = 0;
        for (index = 0; index < getGroupContainerWidget().getWidgetCount(); index++) {
            if (CmsDomUtil.hasClass(HIDDEN_ELEMENT_CLASS, getGroupContainerWidget().getWidget(index).getElement())) {
                break;
            }
        }
        getGroupContainerWidget().insert(elementWidget, index);
        elementWidget.getInheritanceInfo().setVisible(true);
        elementWidget.removeStyleName(HIDDEN_ELEMENT_CLASS);
        updateButtonVisibility(elementWidget);
        getGroupContainerWidget().refreshHighlighting();
        List<Element> elements = CmsDomUtil.getElementsByClass(
            HIDDEN_ELEMENT_OVERLAY_CLASS,
            Tag.div,
            elementWidget.getElement());
        for (Element element : elements) {
            element.removeFromParent();
        }
        if (CmsDomUtil.getElementsByClass(
            HIDDEN_ELEMENT_OVERLAY_CLASS,
            Tag.div,
            getGroupContainerWidget().getElement()).isEmpty()) {
            // if no other hidden elements present disable toggle button
            m_showElementsButton.disable(Messages.get().key(Messages.GUI_INHERITANCECONTAINER_NO_HIDDEN_ELEMENTS_0));
        }
        m_changedInheritanceInfo = true;
    }
576670
protected void uploadFile() {

        hideOkAndUploadButtons();
        CmsUploader uploader = new CmsUploader();
        CmsFileInfo info = m_fileInput.getFiles()[0];
        info.setOverrideFileName(CmsResource.getName(m_replaceInfo.getSitepath()));
        uploader.uploadFiles(
            CmsCoreProvider.get().link(I_CmsUploadConstants.UPLOAD_ACTION_JSP_URI),
            CmsResource.getFolderPath(m_replaceInfo.getSitepath()),
            false,
            Collections.singletonList(info),
            Collections.<String> emptyList(),
            this);
        showProgress();
    }
1154082
protected void setBorder(Widget widget) {

        String cornerAll = org.opencms.gwt.client.ui.css.I_CmsLayoutBundle.INSTANCE.generalCss().cornerAll();
        String border = org.opencms.gwt.client.ui.css.I_CmsLayoutBundle.INSTANCE.generalCss().border();
        widget.addStyleName(border);
        widget.addStyleName(cornerAll);
        widget.getElement().getStyle().setPadding(6, Unit.PX);
    }
38657
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WField field = (WField) component;
		XmlStringBuilder xml = renderContext.getWriter();
		int inputWidth = field.getInputWidth();

		xml.appendTagOpen("ui:field");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", field.isHidden(), "true");
		xml.appendOptionalAttribute("inputWidth", inputWidth > 0, inputWidth);
		xml.appendClose();

		// Label
		WLabel label = field.getLabel();

		if (label != null) {
			label.paint(renderContext);
		}

		// Field
		if (field.getField() != null) {
			xml.appendTag("ui:input");
			field.getField().paint(renderContext);

			if (field.getErrorIndicator() != null) {
				field.getErrorIndicator().paint(renderContext);
			}

			if (field.getWarningIndicator() != null) {
				field.getWarningIndicator().paint(renderContext);
			}

			xml.appendEndTag("ui:input");
		}

		xml.appendEndTag("ui:field");
	}
916254
@Override
	public void paint(final RenderContext renderContext) {
		// Check interceptor is enabled
		if (!DebugValidateXML.isEnabled()) {
			super.paint(renderContext);
			return;
		}

		if (!(renderContext instanceof WebXmlRenderContext)) {
			LOG.warn("Unable to validate against a " + renderContext);
			super.paint(renderContext);
			return;
		}

		LOG.debug("Validate XML Interceptor: Start");

		WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext;
		PrintWriter writer = webRenderContext.getWriter();

		// Generate XML
		StringWriter tempBuffer = new StringWriter();
		PrintWriter tempWriter = new PrintWriter(tempBuffer);
		WebXmlRenderContext tempContext = new WebXmlRenderContext(tempWriter, UIContextHolder.
				getCurrent().getLocale());

		super.paint(tempContext);
		String xml = tempBuffer.toString();

		// If no errors, check against the schema
		String error = DebugValidateXML.validateXMLAgainstSchema(xml);

		if (error != null) {
			// XML is NOT valid, so Report Errors and Wrap the original XML
			LOG.debug("Validate XML Interceptor: XML Has Errors");
			writer.println("<div>");

			writer.println("<div>");
			writer.println("Invalid XML");
			writer.println("<ul><li>" + WebUtilities.encode(error) + "</li></ul>");
			writer.println("<br/>");
			writer.println("</div>");

			// If a schema error detected, Wrap XML so line numbers reported in validation message are correct
			String testXML = DebugValidateXML.wrapXMLInRootElement(xml);
			paintOriginalXML(testXML, writer);

			writer.println("</div>");
		} else {
			// XML is valid
			writer.write(xml);
		}

		LOG.debug("Validate XML Interceptor: Finished");
	}