javax.faces.component.UIOutput Java Examples

The following examples show how to use javax.faces.component.UIOutput. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AddResourcesListener.java    From BootsFaces-OSP with Apache License 2.0 6 votes vote down vote up
private void createAndAddComponent(UIViewRoot root, FacesContext context, String rendererType, String name,
		String library, String position) {

	// if (library != null && BSF_LIBRARY.equals(library)) {
	// boolean loadBsfResource =
	// shouldLibraryBeLoaded(P_GET_BOOTSTRAP_COMPONENTS_FROM_CDN, true);
	//
	// if (! loadBsfResource) {
	// return;
	// }
	// }
	UIOutput output = new UIOutput();
	output.setRendererType(rendererType);
	output.getAttributes().put("name", name);
	output.getAttributes().put("library", library);
	output.getAttributes().put("target", "head");
	if (position != null) {
		output.getAttributes().put("position", position);
	}
	addResourceIfNecessary(root, context, output);
}
 
Example #2
Source File: AddResourcesListener.java    From BootsFaces-OSP with Apache License 2.0 6 votes vote down vote up
/**
 * Add the viewport meta tag if not disabled from context-param
 *
 * @param root
 * @param context
 * @param isProduction
 */
private void addMetaTags(UIViewRoot root, FacesContext context) {
	// Check context-param
	String viewportParam = BsfUtils.getInitParam(C.P_VIEWPORT, context);

	viewportParam = evalELIfPossible(viewportParam);
	String content = "width=device-width, initial-scale=1";
	if (!viewportParam.isEmpty() && isFalseOrNo(viewportParam)) {
		return;
	}
	if (!viewportParam.isEmpty() && !isTrueOrYes(viewportParam)) {
		content = viewportParam;
	}

	// Otherwise
	String viewportMeta = "<meta name=\"viewport\" content=\"" + content + "\"/>";
	UIOutput viewport = new UIOutput();
	viewport.setRendererType("javax.faces.Text");
	viewport.getAttributes().put("escape", false);
	viewport.setValue(viewportMeta);

	UIComponent header = findHeader(root);
	if (header != null) {
		header.getChildren().add(0, viewport);
	}
}
 
Example #3
Source File: XspFunctions.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the clientID of the current XPage-component
 * 
 * @param ctx
 *            the FormulaContext
 * @return the clientID
 */
@ParamCount(0)
public static ValueHolder atThisName(final FormulaContextXsp ctx) {
	UIComponent comp = ctx.getComponent();
	while (comp != null) {
		if (comp instanceof UIOutput) {
			return ValueHolder.valueOf(comp.getClientId(FacesContext.getCurrentInstance()));
			// return ValueHolder.valueOf(((UIOutput) comp).getId());
		}
		comp = comp.getParent();
	}
	return ValueHolder.valueDefault();
}
 
Example #4
Source File: XspFunctions.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the value of the current UIComponent
 * 
 */
@ParamCount(0)
public static ValueHolder atThisValue(final FormulaContextXsp ctx) {
	UIComponent comp = ctx.getComponent();
	while (comp != null) {
		if (comp instanceof UIOutput) {
			return ValueHolder.valueOf(((UIOutput) comp).getValue());
		}
		comp = comp.getParent();
	}
	return ValueHolder.valueDefault();
}
 
Example #5
Source File: AudioUploadActionListener.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * Get audio media upload path from the event's component tree.
 * @param ae  the event
 * @return
 */
private String getAudioMediaUploadPath(FacesEvent ae)
{
  String audioMediaUploadPath = null;

  // now find what component fired the event
  UIComponent component = ae.getComponent();
  // get the subview containing the audio question
  UIComponent parent = component.getParent();

  // get the its peer components from the parent
  List peers = parent.getChildren();

  // look for the correct file upload path information
  // held in the value of the component 'audioMediaUploadPath'
  for (int i = 0; i < peers.size(); i++)
  {
    UIComponent peer = (UIComponent) peers.get(i);

    if ("audioMediaUploadPath".equals(peer.getId()) && peer instanceof UIOutput)
    {
      audioMediaUploadPath = "" + ((UIOutput) peer).getValue();
      log.info("FOUND: Component " + i +
               " peer.getId(): " + peer.getId()+
               " peer.getValue(): " + audioMediaUploadPath );
      break;
    }
  }

  return audioMediaUploadPath;
}
 
Example #6
Source File: AudioUploadActionListener.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * Get audio media upload path from the event's component tree.
 * @param ae  the event
 * @return
 */
private String getAudioMediaUploadPath(FacesEvent ae)
{
  String audioMediaUploadPath = null;

  // now find what component fired the event
  UIComponent component = ae.getComponent();
  // get the subview containing the audio question
  UIComponent parent = component.getParent();

  // get the its peer components from the parent
  List peers = parent.getChildren();

  // look for the correct file upload path information
  // held in the value of the component 'audioMediaUploadPath'
  for (int i = 0; i < peers.size(); i++)
  {
    UIComponent peer = (UIComponent) peers.get(i);

    if ("audioMediaUploadPath".equals(peer.getId()) && peer instanceof UIOutput)
    {
      audioMediaUploadPath = "" + ((UIOutput) peer).getValue();
      log.info("FOUND: Component " + i +
               " peer.getId(): " + peer.getId()+
               " peer.getValue(): " + audioMediaUploadPath );
      break;
    }
  }

  return audioMediaUploadPath;
}
 
Example #7
Source File: AddResourcesListener.java    From BootsFaces-OSP with Apache License 2.0 5 votes vote down vote up
private void addResourceIfNecessary(UIViewRoot root, FacesContext context, UIOutput output) {
	Object libToAdd = output.getAttributes().get("library");
	Object nameToAdd = output.getAttributes().get("name");
	for (UIComponent c : root.getComponentResources(context, "head")) {
		String library = (String) c.getAttributes().get("library");
		String name = (String) c.getAttributes().get("name");
		if (library != null && library.equals(libToAdd) && name != null && name.equals(nameToAdd)) {
			return;
		}
	}
	root.addComponentResource(context, output, "head");
}
 
Example #8
Source File: TimerBarRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
  return (component instanceof UIOutput);
}
 
Example #9
Source File: AppletRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
  return (component instanceof UIOutput);
}
 
Example #10
Source File: NavigationMapRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
  return (component instanceof UIOutput);
}
 
Example #11
Source File: ToolBarMessageRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
  return (component instanceof UIOutput);
}
 
Example #12
Source File: ViewRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
	// this should be just UIViewRoot, but since that's not working now...
	return (component instanceof UIViewRoot) || (component instanceof UIOutput);
}
 
Example #13
Source File: ColorPickerPopupRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
  return (component instanceof UIOutput);
}
 
Example #14
Source File: AlphaIndexRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
  return (component instanceof UIOutput);
}
 
Example #15
Source File: JsfContentTypeMapRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
   return (component instanceof UIOutput);
}
 
Example #16
Source File: TimerBarRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
  return (component instanceof UIOutput);
}
 
Example #17
Source File: GroupBoxRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
	return (component instanceof UIOutput);
}
 
Example #18
Source File: DocSectionRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
	return (component instanceof UIOutput);
}
 
Example #19
Source File: InstructionMessageRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
	return (component instanceof UIOutput);
}
 
Example #20
Source File: PeerRefreshRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
	return (component instanceof UIOutput);
}
 
Example #21
Source File: PopupRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component) {
  return (component instanceof UIOutput);
}
 
Example #22
Source File: ToolBarMessageRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
  return (component instanceof UIOutput);
}
 
Example #23
Source File: ViewRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
	// this should be just UIViewRoot, but since that's not working now...
	return (component instanceof UIViewRoot) || (component instanceof UIOutput);
}
 
Example #24
Source File: DocSectionRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
	return (component instanceof UIOutput);
}
 
Example #25
Source File: JsfContentTypeMapRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
   return (component instanceof UIOutput);
}
 
Example #26
Source File: TimerBarRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
  return (component instanceof UIOutput);
}
 
Example #27
Source File: GroupBoxRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
	return (component instanceof UIOutput);
}
 
Example #28
Source File: ViewTitleRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
	return (component instanceof UIOutput);
}
 
Example #29
Source File: InstructionMessageRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
	return (component instanceof UIOutput);
}
 
Example #30
Source File: OutputDateRenderer.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
public boolean supportsComponentType(UIComponent component)
{
  return (component instanceof UIOutput);
}