Codota Logo
StaticFacesUtils
Code IndexAdd Codota to your IDE (free)

How to use
StaticFacesUtils
in
org.metawidget.statically.faces

Best Java code snippets using org.metawidget.statically.faces.StaticFacesUtils (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: org.metawidget.modules/metawidget-all

  @Override
  public void initNestedMetawidget( StaticMetawidget nestedMetawidget, Map<String, String> attributes ) {

    super.initNestedMetawidget( nestedMetawidget, attributes );

    if ( ( (StaticUIMetawidget) nestedMetawidget ).getValue() == null ) {

      String valueExpression = getValue();
      valueExpression = StaticFacesUtils.unwrapExpression( valueExpression );
      valueExpression += StringUtils.SEPARATOR_DOT_CHAR + attributes.get( NAME );
      valueExpression = StaticFacesUtils.wrapExpression( valueExpression );

      ( (StaticUIMetawidget) nestedMetawidget ).setValue( valueExpression );
    }
  }
}
origin: org.metawidget.modules/metawidget-all

/**
 * @return the original String, wrapped in #{...}. If the original String was already wrapped,
 *         returns the original String
 */
public static String wrapExpression( String value ) {
  if ( isExpression( value ) ) {
    return value;
  }
  return EXPRESSION_START + unwrapExpression( value ) + EXPRESSION_END;
}
origin: org.metawidget.modules/metawidget-all

/**
 * Return <code>true</code> if the specified value conforms to the syntax requirements of a
 * value binding expression.
 * <p>
 * This method is a mirror of the one in <code>UIComponentTag.isValueReference</code>, but that
 * one is deprecated so may be removed in the future.
 *
 * @param value
 *            The value to evaluate
 * @throws NullPointerException
 *             if <code>value</code> is <code>null</code>
 */
public static boolean isExpression( String value ) {
  return matchExpression( value ).matches();
}
origin: org.jboss.forge.addon/scaffold-faces

/**
* Overrriden to enhance the default f:selectItem widget with more suitable item labels
*/
@Override
protected void addSelectItems(HtmlSelectOneMenu select, String valueExpression, Map<String, String> attributes)
{
 // Empty option
 //
 // Note: a 'null' value (rather than an empty String') renders an <f:selectItem/> rather
 // than an <f:selectItem itemValue=""/>. This works out better if the HtmlSelectOneMenu has
 // a converter, because the empty String may not be a compatible value
 if (WidgetBuilderUtils.needsEmptyLookupItem(attributes))
 {
   addSelectItem(select, null, null);
 }
 // Add the select items
 SelectItems selectItems = new SelectItems();
 selectItems.putAttribute("value", valueExpression);
 // For each item to be displayed, set the label to the reverse primary key value
 if (attributes.containsKey(REVERSE_PRIMARY_KEY))
 {
   selectItems.putAttribute("var", SELECT_ITEM);
   selectItems.putAttribute("itemValue", StaticFacesUtils.wrapExpression(SELECT_ITEM));
   String displayExpression = "forgeview:display(_item)";
   ((BaseStaticXmlWidget) selectItems).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
   selectItems.putAttribute("itemLabel", StaticFacesUtils.wrapExpression(displayExpression));
 }
 select.getChildren().add(selectItems);
}
origin: org.metawidget.modules/metawidget-all

  public StaticXmlWidget processWidget( StaticXmlWidget widget, String elementName, Map<String, String> attributes, StaticXmlMetawidget metawidget ) {

    if ( widget instanceof ValueHolder ) {

      // (do not overwrite existing, if any)

      if ( widget.getAttribute( "id" ) == null ) {

        ValueHolder valueWidget = (ValueHolder) widget;
        String valueExpression = valueWidget.getValue();

        if ( valueExpression != null && !"".equals( valueExpression )) {
          valueExpression = StaticFacesUtils.unwrapExpression( valueExpression );
          widget.putAttribute( "id", StringUtils.camelCase( valueExpression, StringUtils.SEPARATOR_DOT_CHAR ) );
        }
      }
    }

    return widget;
  }
}
origin: org.jboss.forge/forge-scaffold-faces

/**
* Overrriden to enhance the default f:selectItem widget with more suitable item labels
*/
@Override
protected void addSelectItems( HtmlSelectOneMenu select, String valueExpression, Map<String, String> attributes ) {
 // Empty option
 //
 // Note: a 'null' value (rather than an empty String') renders an <f:selectItem/> rather
 // than an <f:selectItem itemValue=""/>. This works out better if the HtmlSelectOneMenu has
 // a converter, because the empty String may not be a compatible value
 if ( WidgetBuilderUtils.needsEmptyLookupItem( attributes ) ) {
   addSelectItem( select, null, null );
 }
 // Add the select items
 SelectItems selectItems = new SelectItems();
 selectItems.putAttribute("value", valueExpression);
 // For each item to be displayed, set the label to the reverse primary key value
 if (attributes.containsKey(REVERSE_PRIMARY_KEY))
 {
   selectItems.putAttribute("var", SELECT_ITEM);
   selectItems.putAttribute("itemValue", StaticFacesUtils.wrapExpression(SELECT_ITEM));
   String displayExpression = "forgeview:display(_item)";
   ((BaseStaticXmlWidget) selectItems).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
   selectItems.putAttribute("itemLabel", StaticFacesUtils.wrapExpression(displayExpression));
 }
 select.getChildren().add( selectItems );
}
origin: org.metawidget.modules/metawidget-all

valueExpression = StaticFacesUtils.unwrapExpression( valueExpression );
valueExpression += StringUtils.SEPARATOR_DOT_CHAR;
valueExpression = StaticFacesUtils.wrapExpression( valueExpression );
origin: org.jboss.forge.addon/scaffold-faces

param.putAttribute(
    "value",
    StaticFacesUtils.wrapExpression(dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR
         + primaryKeyName));
link.getChildren().add(param);
      + StringUtils.SEPARATOR_DOT_CHAR
      + StringUtils.decapitalize(columnAttributes.get(NAME));
 output.setValue(StaticFacesUtils.wrapExpression(displayExpression));
 output.setValue(StaticFacesUtils.wrapExpression(valueExpression));
   footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName));
   footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName);
   footerMetawidget.setLayout(new SimpleLayout());
origin: org.jboss.forge.addon/scaffold-faces

     StaticFacesUtils.wrapExpression("!empty " + StaticFacesUtils.unwrapExpression(link.getValue())));
param.putAttribute(
     "value",
     StaticFacesUtils.wrapExpression(StaticFacesUtils.unwrapExpression(link.getValue())
         + StringUtils.SEPARATOR_DOT_CHAR
         + reverseKey));
  String styleClassEl = StaticFacesUtils.unwrapExpression(outputText.getValue())
      + " ? 'boolean-true' : 'boolean-false'";
  outputText.putAttribute("styleClass", StaticFacesUtils.wrapExpression(styleClassEl));
  outputText.setValue("");
String unwrappedExpression = StaticFacesUtils.unwrapExpression(nestedMetawidget.getValue());
nestedMetawidget.putAttribute("rendered",
     StaticFacesUtils.wrapExpression("!empty " + unwrappedExpression));
commandLink.putAttribute(
     "action",
     StaticFacesUtils.wrapExpression(parentExpression + ".new"
         + StringUtils.capitalize(childExpression)));
commandLink.putAttribute("rendered", StaticFacesUtils.wrapExpression("empty " + unwrappedExpression));
origin: org.jboss.forge/forge-scaffold-faces

param.putAttribute(
    "value",
    StaticFacesUtils.wrapExpression(dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR
         + primaryKeyName));
link.getChildren().add(param);
      + StringUtils.decapitalize(columnAttributes.get(NAME)) + ")";
 ((BaseStaticXmlWidget) link).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
 output.setValue(StaticFacesUtils.wrapExpression(displayExpression));
 output.setValue(StaticFacesUtils.wrapExpression(valueExpression));
   footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName));
   footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName);
   footerMetawidget.setLayout(new SimpleLayout());
origin: org.jboss.forge/forge-scaffold-faces

param.putAttribute(
     "value",
     StaticFacesUtils.wrapExpression(StaticFacesUtils.unwrapExpression(link.getValue()) + StringUtils.SEPARATOR_DOT_CHAR
         + reverseKey));
link.getChildren().add(param);
  String styleClassEl = StaticFacesUtils.unwrapExpression(outputText.getValue())
      + " ? 'boolean-true' : 'boolean-false'";
  outputText.putAttribute("styleClass", StaticFacesUtils.wrapExpression(styleClassEl));
  outputText.setValue("");
String unwrappedExpression = StaticFacesUtils.unwrapExpression(nestedMetawidget.getValue());
nestedMetawidget.putAttribute("rendered",
     StaticFacesUtils.wrapExpression("!empty " + unwrappedExpression));
commandLink.putAttribute(
     "action",
     StaticFacesUtils.wrapExpression(parentExpression + ".new"
         + StringUtils.capitalize(childExpression)));
commandLink.putAttribute("rendered", StaticFacesUtils.wrapExpression("empty " + unwrappedExpression));
origin: org.jboss.forge/forge-scaffold-faces

attributes
    .put(FACES_LOOKUP,
         StaticFacesUtils.wrapExpression(StringUtils.decapitalize(ClassUtils.getSimpleName(property
             .getType())) + "Bean.all"));
         StaticFacesUtils.wrapExpression(StringUtils.decapitalize(ClassUtils.getSimpleName(property
             .getType())) + "Bean.converter"));
origin: org.jboss.forge/forge-scaffold-faces

removeLink.putAttribute("styleClass", "remove-button");
String removeExpression = COLLECTION_VAR + ".remove(" + dataTable.getAttribute("var") + ")";
removeLink.putAttribute("action", StaticFacesUtils.wrapExpression(removeExpression));
   addLink.putAttribute("styleClass", "add-button");
   String addExpression = COLLECTION_VAR + ".add(" + controllerName + "Bean.added)";
   addLink.putAttribute("action", StaticFacesUtils.wrapExpression(addExpression));
   setPropertyActionListener.putAttribute(
        "target",
        StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + inverseRelationship));
   StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class);
   String id = StaticFacesUtils.unwrapExpression(setPropertyActionListener.getValue())
        + StringUtils.SEPARATOR_DOT_CHAR + attributes.get(NAME) + StringUtils.SEPARATOR_DOT_CHAR + "Add";
origin: org.metawidget.modules/metawidget-all

  columnContents.putAttribute( "value", StaticFacesUtils.wrapExpression( dataTable.getAttribute( "var" ) ) );
} else {
  columnContents.putAttribute( "value", StaticFacesUtils.wrapExpression( valueExpression ) );
origin: org.jboss.forge.addon/scaffold-faces

removeLink.putAttribute("styleClass", "remove-button");
String removeExpression = COLLECTION_VAR + ".remove(" + dataTable.getAttribute("var") + ")";
removeLink.putAttribute("action", StaticFacesUtils.wrapExpression(removeExpression));
   addLink.putAttribute("styleClass", "add-button");
   String addExpression = COLLECTION_VAR + ".add(" + controllerName + "Bean.added)";
   addLink.putAttribute("action", StaticFacesUtils.wrapExpression(addExpression));
   setPropertyActionListener.putAttribute(
        "target",
        StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + inverseRelationship));
   StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class);
   String id = StaticFacesUtils.unwrapExpression(setPropertyActionListener.getValue())
        + StringUtils.SEPARATOR_DOT_CHAR + attributes.get(NAME) + StringUtils.SEPARATOR_DOT_CHAR + "Add";
origin: org.jboss.forge.addon/scaffold-faces

attributes
    .put(FACES_LOOKUP,
         StaticFacesUtils.wrapExpression(StringUtils.decapitalize(ClassUtils.getSimpleName(property
             .getType())) + "Bean.all"));
         StaticFacesUtils.wrapExpression(StringUtils.decapitalize(ClassUtils.getSimpleName(property
             .getType())) + "Bean.converter"));
origin: org.jboss.forge.addon/scaffold-faces

String asListValueExpression = "forgeview:asList(" + StaticFacesUtils.unwrapExpression(tableValueExpression)
    + ")";
valueHolderTable.setValue(StaticFacesUtils.wrapExpression(asListValueExpression));
((BaseStaticXmlWidget) dataTable).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
valueHolderTable.setValue(StaticFacesUtils.wrapExpression("forgeview:asList(" + COLLECTION_VAR + ")"));
valueHolderTable.setValue(StaticFacesUtils.wrapExpression(COLLECTION_VAR));
select.putAttribute("id", selectId);
String requestScopedValue = "requestScope['" + selectId + "']";
select.setValue(StaticFacesUtils.wrapExpression(requestScopedValue));
String simpleComponentType = ClassUtils.getSimpleName(componentType);
String controllerName = StringUtils.decapitalize(simpleComponentType);
select.setConverter(StaticFacesUtils.wrapExpression(controllerName + "Bean.converter"));
addSelectItems(select, StaticFacesUtils.wrapExpression(controllerName + "Bean.all"), attributes);
panelGrid.getChildren().add(select);
addLink.putAttribute("styleClass", "add-button");
String addExpression = COLLECTION_VAR + ".add(" + requestScopedValue + ")";
addLink.putAttribute("action", StaticFacesUtils.wrapExpression(addExpression));
addLink.putAttribute("onclick", "if (document.getElementById(document.forms[0].id+':" + selectId
    + "').selectedIndex &lt; 1) { alert('Must select a " + StringUtils.uncamelCase(simpleComponentType)
origin: org.jboss.forge.addon/scaffold-faces

this.entityMetawidget.setValue(StaticFacesUtils.wrapExpression(beanName + "." + ccEntity));
this.entityMetawidget.setPath(entity.getQualifiedName());
this.entityMetawidget.setReadOnly(false);
this.searchMetawidget.setValue(StaticFacesUtils.wrapExpression(beanName + ".example"));
this.searchMetawidget.setPath(entity.getQualifiedName());
this.beanMetawidget.setValue(StaticFacesUtils.wrapExpression(beanName + ".pageItems"));
this.beanMetawidget.setPath(viewBean.getQualifiedName() + "/pageItems");
writeSearchAndBeanMetawidget(context, this.searchTemplateSearchMetawidgetIndent,
origin: org.jboss.forge/forge-scaffold-faces

String asListValueExpression = "forgeview:asList(" + StaticFacesUtils.unwrapExpression(tableValueExpression)
    + ")";
valueHolderTable.setValue(StaticFacesUtils.wrapExpression(asListValueExpression));
((BaseStaticXmlWidget) dataTable).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
valueHolderTable.setValue(StaticFacesUtils.wrapExpression("forgeview:asList(" + COLLECTION_VAR + ")"));
valueHolderTable.setValue(StaticFacesUtils.wrapExpression(COLLECTION_VAR));
select.putAttribute("id", selectId);
String requestScopedValue = "requestScope['" + selectId + "']";
select.setValue(StaticFacesUtils.wrapExpression(requestScopedValue));
String simpleComponentType = ClassUtils.getSimpleName(componentType);
String controllerName = StringUtils.decapitalize(simpleComponentType);
select.setConverter(StaticFacesUtils.wrapExpression(controllerName + "Bean.converter"));
addSelectItems(select, StaticFacesUtils.wrapExpression(controllerName + "Bean.all"), attributes);
panelGrid.getChildren().add(select);
addLink.putAttribute("styleClass", "add-button");
String addExpression = COLLECTION_VAR + ".add(" + requestScopedValue + ")";
addLink.putAttribute("action", StaticFacesUtils.wrapExpression(addExpression));
addLink.putAttribute("onclick", "if (document.getElementById(document.forms[0].id+':" + selectId
    + "').selectedIndex &lt; 1) { alert('Must select a " + StringUtils.uncamelCase(simpleComponentType)
origin: org.jboss.forge/forge-scaffold-faces

this.entityMetawidget.setValue(StaticFacesUtils.wrapExpression(beanName + "." + ccEntity));
this.entityMetawidget.setPath(entity.getQualifiedName());
this.entityMetawidget.setReadOnly(false);
this.searchMetawidget.setValue(StaticFacesUtils.wrapExpression(beanName + ".example"));
this.searchMetawidget.setPath(entity.getQualifiedName());
this.beanMetawidget.setValue(StaticFacesUtils.wrapExpression(beanName + ".pageItems"));
this.beanMetawidget.setPath(viewBean.getQualifiedName() + "/pageItems");
writeSearchAndBeanMetawidget(context, this.searchTemplateSearchMetawidgetIndent,
org.metawidget.statically.facesStaticFacesUtils

Javadoc

Utilities for working with Java Server Faces statically.

Most used methods

  • unwrapExpression
  • wrapExpression
  • isExpression
    Return true if the specified value conforms to the syntax requirements of a value binding expression
  • matchExpression

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now