Examples of StaticHtmlMetawidget


Examples of org.metawidget.statically.faces.component.html.StaticHtmlMetawidget

               return null;
            }

            // Create nestedMetawidget with conditional 'rendered' attribute

            StaticHtmlMetawidget nestedMetawidget = new StaticHtmlMetawidget();
            metawidget.initNestedMetawidget(nestedMetawidget, attributes);
            String unwrappedExpression = StaticFacesUtils.unwrapExpression(nestedMetawidget.getValue());
            nestedMetawidget.putAttribute("rendered",
                     StaticFacesUtils.wrapExpression("!empty " + unwrappedExpression));

            // If read-only we're done

            if (WidgetBuilderUtils.isReadOnly(attributes))
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.StaticHtmlMetawidget

            // If it's an inverse relationship, we really should have been able to determine sub-properties, so we
            // should never be at 'entity' level *unless* componentType couldn't resolve to an actual type

            if (!ENTITY.equals(elementName))
            {
               StaticHtmlMetawidget footerMetawidget = new StaticHtmlMetawidget();
               Map<String, String> footerAttributes = CollectionUtils.newHashMap();
               metawidget.initNestedMetawidget(footerMetawidget, footerAttributes);

               // (footer facets should never have a 'required' attribute)

               footerMetawidget.removeWidgetProcessor(footerMetawidget
                        .getWidgetProcessor(RequiredAttributeProcessor.class));
               footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName));
               footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName);
               footerMetawidget.setLayout(new SimpleLayout());

               Facet footerFacet = new Facet();
               footerFacet.putAttribute("name", "footer");
               footerFacet.getChildren().add(footerMetawidget);

               ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class);

               if (readableIdProcessor != null)
               {
                  readableIdProcessor.processWidget(footerMetawidget, elementName, columnAttributes, metawidget);
               }

               HtmlMessage message = new HtmlMessage();
               message.putAttribute("for", footerMetawidget.getAttribute("id"));
               message.putAttribute("styleClass", "error");
               footerFacet.getChildren().add(message);
               column.getChildren().add(footerFacet);
            }
         }
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.StaticHtmlMetawidget

   {
      super.setProject(project);

      ForgeConfigReader configReader = new ForgeConfigReader(this.config, this.project);

      this.entityMetawidget = new StaticHtmlMetawidget();
      this.entityMetawidget.setConfigReader(configReader);
      this.entityMetawidget.setConfig("scaffold/faces/metawidget-entity.xml");

      this.searchMetawidget = new StaticHtmlMetawidget();
      this.searchMetawidget.setConfigReader(configReader);
      this.searchMetawidget.setConfig("scaffold/faces/metawidget-search.xml");

      this.beanMetawidget = new StaticHtmlMetawidget();
      this.beanMetawidget.setConfigReader(configReader);
      this.beanMetawidget.setConfig("scaffold/faces/metawidget-bean.xml");

      this.qbeMetawidget = new StaticJavaMetawidget();
      this.qbeMetawidget.setConfigReader(configReader);
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.StaticHtmlMetawidget

               return null;
            }

            // Create nestedMetawidget with conditional 'rendered' attribute

            StaticHtmlMetawidget nestedMetawidget = new StaticHtmlMetawidget();
            metawidget.initNestedMetawidget(nestedMetawidget, attributes);
            String unwrappedExpression = StaticFacesUtils.unwrapExpression(nestedMetawidget.getValue());
            nestedMetawidget.putAttribute("rendered",
                     StaticFacesUtils.wrapExpression("!empty " + unwrappedExpression));

            // If read-only we're done

            if (WidgetBuilderUtils.isReadOnly(attributes))
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.StaticHtmlMetawidget

            // If it's an inverse relationship, we really should have been able to determine sub-properties, so we
            // should never be at 'entity' level *unless* componentType couldn't resolve to an actual type

            if (!ENTITY.equals(elementName))
            {
               StaticHtmlMetawidget footerMetawidget = new StaticHtmlMetawidget();
               Map<String, String> footerAttributes = CollectionUtils.newHashMap();
               metawidget.initNestedMetawidget(footerMetawidget, footerAttributes);

               // (footer facets should never have a 'required' attribute)

               footerMetawidget.removeWidgetProcessor(footerMetawidget
                        .getWidgetProcessor(RequiredAttributeProcessor.class));
               footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName));
               footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName);
               footerMetawidget.setLayout(new SimpleLayout());

               Facet footerFacet = new Facet();
               footerFacet.putAttribute("name", "footer");
               footerFacet.getChildren().add(footerMetawidget);

               ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class);

               if (readableIdProcessor != null)
               {
                  readableIdProcessor.processWidget(footerMetawidget, elementName, columnAttributes, metawidget);
               }

               HtmlMessage message = new HtmlMessage();
               message.putAttribute("for", footerMetawidget.getAttribute("id"));
               message.putAttribute("styleClass", "error");
               footerFacet.getChildren().add(message);
               column.getChildren().add(footerFacet);
            }
         }
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.StaticHtmlMetawidget

               return null;
            }

            // Create nestedMetawidget with conditional 'rendered' attribute

            StaticHtmlMetawidget nestedMetawidget = new StaticHtmlMetawidget();
            metawidget.initNestedMetawidget(nestedMetawidget, attributes);
            String unwrappedExpression = StaticFacesUtils.unwrapExpression(nestedMetawidget.getValue());
            nestedMetawidget.putAttribute("rendered",
                     StaticFacesUtils.wrapExpression("!empty " + unwrappedExpression));

            // If read-only we're done

            if (WidgetBuilderUtils.isReadOnly(attributes))
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.StaticHtmlMetawidget

                           + primaryKeyName));
         link.getChildren().add(param);
         link.getChildren().add(column.getChildren().remove(1));
         if (columnAttributes.containsKey(FACES_LOOKUP) && columnAttributes.containsKey(REVERSE_PRIMARY_KEY))
         {
            StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1);
            String displayExpression = "forgeview:display(" + dataTable.getAttribute("var")
                     + StringUtils.SEPARATOR_DOT_CHAR
                     + StringUtils.decapitalize(columnAttributes.get(NAME)) + ")";
            ((BaseStaticXmlWidget) link).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
            output.setValue(StaticFacesUtils.wrapExpression(displayExpression));
         }
         if (tableAttributes.get(PARAMETERIZED_TYPE_PATH) != null)
         {
            // Recreate the EL expression. This is done to ensure that correctly nested EL expressions are created for
            // expanded entities. The originally created expression in super.addColumnComponent is incorrect for
            // expanded entities since it assumes that all referenced names are at the same level
            String valueExpression = dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR
                     + tableAttributes.get(PARAMETERIZED_TYPE_PATH) + StringUtils.SEPARATOR_DOT_CHAR
                     + StringUtils.decapitalize(columnAttributes.get(NAME));

            StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1);
            output.setValue(StaticFacesUtils.wrapExpression(valueExpression));
         }
         column.getChildren().add(link);

         // If bidirectional, add a footer facet

         if (tableAttributes.containsKey(INVERSE_RELATIONSHIP) && !metawidget.isReadOnly())
         {
            // If it's an inverse relationship, we really should have been able to determine sub-properties, so we
            // should never be at 'entity' level *unless* componentType couldn't resolve to an actual type

            if (!ENTITY.equals(elementName))
            {
               StaticHtmlMetawidget footerMetawidget = new StaticHtmlMetawidget();
               Map<String, String> footerAttributes = CollectionUtils.newHashMap();
               metawidget.initNestedMetawidget(footerMetawidget, footerAttributes);

               // (footer facets should never have a 'required' attribute)

               footerMetawidget.removeWidgetProcessor(footerMetawidget
                        .getWidgetProcessor(RequiredAttributeProcessor.class));
               footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName));
               footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName);
               footerMetawidget.setLayout(new SimpleLayout());

               Facet footerFacet = new Facet();
               footerFacet.putAttribute("name", "footer");
               footerFacet.getChildren().add(footerMetawidget);

               ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class);

               if (readableIdProcessor != null)
               {
                  readableIdProcessor.processWidget(footerMetawidget, elementName, columnAttributes, metawidget);
               }

               HtmlMessage message = new HtmlMessage();
               message.putAttribute("for", footerMetawidget.getAttribute("id"));
               message.putAttribute("styleClass", "error");
               footerFacet.getChildren().add(message);
               column.getChildren().add(footerFacet);
            }
         }
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.StaticHtmlMetawidget

   private void resetMetaWidgets()
   {
      ForgeConfigReader configReader = new ForgeConfigReader(this.config, this.project);

      this.entityMetawidget = new StaticHtmlMetawidget();
      this.entityMetawidget.setConfigReader(configReader);
      this.entityMetawidget.setConfig(SCAFFOLD_META_WIDGET_ENTITY);

      this.searchMetawidget = new StaticHtmlMetawidget();
      this.searchMetawidget.setConfigReader(configReader);
      this.searchMetawidget.setConfig(SCAFFOLD_META_WIDGET_SEARCH);

      this.beanMetawidget = new StaticHtmlMetawidget();
      this.beanMetawidget.setConfigReader(configReader);
      this.beanMetawidget.setConfig(SCAFFOLD_META_WIDGET_BEAN);

      this.qbeMetawidget = new StaticJavaMetawidget();
      this.qbeMetawidget.setConfigReader(configReader);
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.StaticHtmlMetawidget

               return null;
            }

            // Create nestedMetawidget with conditional 'rendered' attribute

            StaticHtmlMetawidget nestedMetawidget = new StaticHtmlMetawidget();
            metawidget.initNestedMetawidget(nestedMetawidget, attributes);
            String unwrappedExpression = StaticFacesUtils.unwrapExpression(nestedMetawidget.getValue());
            nestedMetawidget.putAttribute("rendered",
                     StaticFacesUtils.wrapExpression("!empty " + unwrappedExpression));

            // If read-only we're done

            if (WidgetBuilderUtils.isReadOnly(attributes))
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.StaticHtmlMetawidget

                           + primaryKeyName));
         link.getChildren().add(param);
         link.getChildren().add(column.getChildren().remove(1));
         if(columnAttributes.containsKey(FACES_LOOKUP) && columnAttributes.containsKey(REVERSE_PRIMARY_KEY))
         {
            StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1);
            String displayExpression = "forgeview:display(" + dataTable.getAttribute("var")
                     + StringUtils.SEPARATOR_DOT_CHAR
                     + StringUtils.decapitalize(columnAttributes.get(NAME)) + ")";
            ((BaseStaticXmlWidget) link).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
            output.setValue(StaticFacesUtils.wrapExpression(displayExpression));
         }
         if (tableAttributes.get(PARAMETERIZED_TYPE_PATH) != null)
         {
            // Recreate the EL expression. This is done to ensure that correctly nested EL expressions are created for
            // expanded entities. The originally created expression in super.addColumnComponent is incorrect for
            // expanded entities since it assumes that all referenced names are at the same level
            String valueExpression = dataTable.getAttribute("var") + StringUtils.SEPARATOR_DOT_CHAR
                     + tableAttributes.get(PARAMETERIZED_TYPE_PATH) + StringUtils.SEPARATOR_DOT_CHAR
                     + StringUtils.decapitalize(columnAttributes.get(NAME));
           
            StaticHtmlMetawidget output = (StaticHtmlMetawidget) link.getChildren().get(1);
            output.setValue(StaticFacesUtils.wrapExpression(valueExpression));
         }
         column.getChildren().add(link);

         // If bidirectional, add a footer facet

         if (tableAttributes.containsKey(INVERSE_RELATIONSHIP) && !metawidget.isReadOnly())
         {
            // If it's an inverse relationship, we really should have been able to determine sub-properties, so we
            // should never be at 'entity' level *unless* componentType couldn't resolve to an actual type

            if (!ENTITY.equals(elementName))
            {
               StaticHtmlMetawidget footerMetawidget = new StaticHtmlMetawidget();
               Map<String, String> footerAttributes = CollectionUtils.newHashMap();
               metawidget.initNestedMetawidget(footerMetawidget, footerAttributes);

               // (footer facets should never have a 'required' attribute)

               footerMetawidget.removeWidgetProcessor(footerMetawidget
                        .getWidgetProcessor(RequiredAttributeProcessor.class));
               footerMetawidget.setValue(StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + columnName));
               footerMetawidget.setPath(componentType + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + columnName);
               footerMetawidget.setLayout(new SimpleLayout());

               Facet footerFacet = new Facet();
               footerFacet.putAttribute("name", "footer");
               footerFacet.getChildren().add(footerMetawidget);

               ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class);

               if (readableIdProcessor != null)
               {
                  readableIdProcessor.processWidget(footerMetawidget, elementName, columnAttributes, metawidget);
               }

               HtmlMessage message = new HtmlMessage();
               message.putAttribute("for", footerMetawidget.getAttribute("id"));
               message.putAttribute("styleClass", "error");
               footerFacet.getChildren().add(message);
               column.getChildren().add(footerFacet);
            }
         }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.