Examples of HtmlPanelGrid


Examples of javax.faces.component.html.HtmlPanelGrid

        }
        String captionClass;
        String captionStyle;
        if (component instanceof HtmlPanelGrid)
        {
            HtmlPanelGrid panelGrid = (HtmlPanelGrid) component;
            captionClass = panelGrid.getCaptionClass();
            captionStyle = panelGrid.getCaptionStyle();
        }
        else if (component instanceof HtmlDataTable)
        {
            HtmlDataTable dataTable = (HtmlDataTable) component;
            captionClass = dataTable.getCaptionClass();
View Full Code Here

Examples of javax.faces.component.html.HtmlPanelGrid


    @Override
    protected UIComponent createComponentToTest()
    {
        return new HtmlPanelGrid();
    }
View Full Code Here

Examples of javax.faces.component.html.HtmlPanelGrid

            constraintEditorDiv.setStyle("text-align:center;font-size:10pt;" + hideStyle);
            output = new HtmlOutputText();
            output.setEscape(false);
            output.setValue(Messages.getStringJSF("constraint.info.new") + "<br />");
            constraintEditorDiv.getChildren().add(output);
            HtmlPanelGrid panel = new HtmlPanelGrid();
            panel.setStyle("font-size:10pt;text-align:left;");
            panel.setColumns(2);
            if (workflowStates != null) {
                HtmlOutputText outputWorkflowState = new HtmlOutputText();
                outputWorkflowState.setValue(Messages.getStringJSF("constraint.info.workflowState"));
                panel.getChildren().add(outputWorkflowState);
                HtmlSelectOneMenu select = new HtmlSelectOneMenu();
                UISelectItem item = new UISelectItem();
                item.setItemValue(null);
                item.setItemLabel(Messages.getStringJSF("constraint.workflowstate.all"));
                select.getChildren().add(item);
                select.setId("workflowState" + getItemUuid());
                for (WorkflowState workflowState : workflowStates) {
                    item = new UISelectItem();
                    item.setItemValue(workflowState.getUuid());
                    item.setItemLabel(workflowState.getDisplayName());
                    select.getChildren().add(item);
                }
                panel.getChildren().add(select);
            }
            HtmlOutputText outputConstraintType = new HtmlOutputText();
            outputConstraintType.setValue(Messages.getStringJSF("constraint.info.constraintType"));
            panel.getChildren().add(outputConstraintType);
            HtmlSelectOneMenu select = new HtmlSelectOneMenu();
            select.setId("constraintType" + getItemUuid());
            for (ConstraintType constraintType : ConstraintType.values()) {
                if (constraintType != ConstraintType.DEFAULT) {
                    UISelectItem item = new UISelectItem();
                    item.setItemValue(constraintType);
                    item.setItemLabel(Messages.getStringJSF("ConstraintType." + constraintType.name()));
                    select.getChildren().add(item);
                }
            }
            panel.getChildren().add(select);
            if (constraintClients != null) {
                HtmlOutputText outputConstraintClient = new HtmlOutputText();
                outputConstraintClient.setValue(Messages.getStringJSF("constraint.info.constraintClient"));
                panel.getChildren().add(outputConstraintClient);
                select = new HtmlSelectOneMenu();
                select.setId("constraintClient" + getItemUuid());
                UISelectItem item = new UISelectItem();
                item.setItemValue(null);
                item.setItemLabel(Messages.getStringJSF("constraint.constraintclient.all"));
                select.getChildren().add(item);
                for (ConstraintClient constraintClient : constraintClients) {
                    item = new UISelectItem();
                    item.setItemValue(constraintClient.getUuid());
                    item.setItemLabel(constraintClient.getDisplayName());
                    select.getChildren().add(item);
                }
                panel.getChildren().add(select);
            }
            HtmlOutputText empty = new HtmlOutputText();
            panel.getChildren().add(empty);
            HtmlOutputText save = new HtmlOutputText();
            save.setEscape(false);
            save.setValue("<button href=\"#\" onclick=\"addConstraint('" + getItemUuid() + "','" + getItemUuid() + "');\">"
                    + Messages.getStringJSF("constraint.button.add")
                    + "</button>");
            panel.getChildren().add(save);
            constraintEditorDiv.getChildren().add(panel);
            HtmlPanelGrid listPanel = new HtmlPanelGrid();
            listPanel.setStyle("font-size:10pt;text-align:left;");
            int columns = 7;
            if (workflowStates == null) {
                columns = columns - 2;
            }
            if (constraintClients == null) {
                columns = columns - 2;
            }
            listPanel.setColumns(columns);
            if (constraints != null) {
                if (!constraints.isEmpty()) {
                    output = new HtmlOutputText();
                    output.setEscape(false);
                    output.setValue("<br />" + Messages.getStringJSF("constraint.info.current") + "<br />");
                    constraintEditorDiv.getChildren().add(output);
                }
                for (Constraint constraint : constraints) {
                    if (workflowStates != null) {
                        HtmlOutputText tmpOutput = new HtmlOutputText();
                        if (constraint.getWorkflowState() != null) {
                            tmpOutput.setValue(constraint.getWorkflowState().getDisplayName() + ",");
                        } else {
                            tmpOutput.setValue(Messages.getStringJSF("constraint.workflowstate.all") + ",");
                        }
                        HtmlOutputText outputWorkflowState = new HtmlOutputText();
                        outputWorkflowState.setValue(Messages.getStringJSF("constraint.info.workflowState"));
                        listPanel.getChildren().add(outputWorkflowState);
                        listPanel.getChildren().add(tmpOutput);
                    }
                    HtmlOutputText tmpOutput = new HtmlOutputText();
                    String comma = ",";
                    if (constraintClients == null) {
                        comma = "";
                    }
                    tmpOutput.setValue(Messages.getStringJSF("ConstraintType." + constraint.getConstraintType().name()) + comma);
                    outputConstraintType = new HtmlOutputText();
                    outputConstraintType.setValue(Messages.getStringJSF("constraint.info.constraintType"));
                    listPanel.getChildren().add(outputConstraintType);
                    listPanel.getChildren().add(tmpOutput);
                    if (constraintClients != null) {
                        tmpOutput = new HtmlOutputText();
                        if (constraint.getConstraintClient() != null) {
                            tmpOutput.setValue(constraint.getConstraintClient().getDisplayName());
                        } else {
                            tmpOutput.setValue(Messages.getStringJSF("constraint.constraintclient.all"));
                        }
                        HtmlOutputText outputConstraintClient = new HtmlOutputText();
                        outputConstraintClient.setValue(Messages.getStringJSF("constraint.info.constraintClient"));
                        listPanel.getChildren().add(outputConstraintClient);
                        listPanel.getChildren().add(tmpOutput);
                    }
                    tmpOutput = new HtmlOutputText();
                    tmpOutput.setEscape(false);
                    tmpOutput.setValue("<div class=\"deleteConstraint\" onclick=\"deleteConstraint('" + constraint.hashCode() + "','" + getItemUuid() + "');\"></div>");
                    listPanel.getChildren().add(tmpOutput);
                }
            }
            constraintEditorDiv.getChildren().add(listPanel);
            getChildren().add(constraintEditorDiv);
        }
View Full Code Here

Examples of javax.faces.component.html.HtmlPanelGrid

    public static final String FAMILY = "at.rits.formbuilder";

    @Override
    public void encodeBegin(FacesContext ctx, UIComponent component) throws IOException {
        FormDataResultInternal formDatasResult = (FormDataResultInternal)component;
        HtmlPanelGrid panelGrid = new HtmlPanelGrid();
        panelGrid.setColumns(2);
        Collection<FormDataResult> formDataResults = FormDataResultFactory.getFormDataResults(formDatasResult.getFormDatas());
        for(FormDataResult formDataResult : formDataResults) {
            String description = formDataResult.getFormBuilderItem().getProperties().getLabel();
            HtmlOutputText descriptionHtmlOutputText = new HtmlOutputText();
            descriptionHtmlOutputText.setValue(description);
            panelGrid.getChildren().add(descriptionHtmlOutputText);
            if(formDataResult instanceof FormDataPieChartResult) {
                FormDataResultPieChart pieChartComponent = new FormDataResultPieChart();
                pieChartComponent.setPieChart((FormDataPieChartResult)formDataResult);
                panelGrid.getChildren().add(pieChartComponent);
            } else if(formDataResult instanceof FormDataStringResult) {
                FormDataResultString stringFormDatasResultComponent = new FormDataResultString();
                stringFormDatasResultComponent.setStringFormDataResult((FormDataStringResult)formDataResult);
                panelGrid.getChildren().add(stringFormDatasResultComponent);
            } else if(formDataResult instanceof FormDataFloatResult) {
                FormDataResultFloat floatFormDatasResultComponent = new FormDataResultFloat();
                floatFormDatasResultComponent.setFloatFormDataResult((FormDataFloatResult)formDataResult);
                panelGrid.getChildren().add(floatFormDatasResultComponent);
            }
        }
        component.getChildren().add(panelGrid);
    }
View Full Code Here

Examples of javax.faces.component.html.HtmlPanelGrid

        }
        String captionClass;
        String captionStyle;
        if (component instanceof HtmlPanelGrid)
        {
            HtmlPanelGrid panelGrid = (HtmlPanelGrid) component;
            captionClass = panelGrid.getCaptionClass();
            captionStyle = panelGrid.getCaptionStyle();
        }
        else if (component instanceof HtmlDataTable)
        {
            HtmlDataTable dataTable = (HtmlDataTable) component;
            captionClass = dataTable.getCaptionClass();
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.layout.HtmlPanelGrid

      // If not bidirectional, create an 'Add' section (bidirectional does it 'in place')

      if (!attributes.containsKey(INVERSE_RELATIONSHIP))
      {
         HtmlPanelGrid panelGrid = new HtmlPanelGrid();
         panelGrid.putAttribute("styleClass", "data-table-footer");
         panelGrid.putAttribute("columns", "2");
         panelGrid.putAttribute("columnClasses", ",remove-column");

         // Select menu at bottom

         HtmlSelectOneMenu select = new HtmlSelectOneMenu();
         String selectId = dataTable.getAttribute("id") + "Select";
         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"));
         Map<String, String> emptyAttributes = CollectionUtils.newHashMap();
         addSelectItems(select, StaticFacesUtils.wrapExpression(controllerName + "Bean.all"), emptyAttributes);
         panelGrid.getChildren().add(select);

         // Create 'Add' button

         HtmlCommandLink addLink = new HtmlCommandLink();
         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)
                  + "'); return false; }");

         // (id is useful for unit tests)

         addLink.putAttribute("id", dataTable.getAttribute("id") + "Add");
         panelGrid.getChildren().add(addLink);

         panelGroup.getChildren().add(panelGrid);
      }

      return panelGroup;
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.layout.HtmlPanelGrid

      // If not bidirectional, create an 'Add' section (bidirectional does it 'in place')

      if (!attributes.containsKey(INVERSE_RELATIONSHIP))
      {
         HtmlPanelGrid panelGrid = new HtmlPanelGrid();
         panelGrid.putAttribute("styleClass", "data-table-footer");
         panelGrid.putAttribute("columns", "2");
         panelGrid.putAttribute("columnClasses", ",remove-column");

         // Select menu at bottom

         HtmlSelectOneMenu select = new HtmlSelectOneMenu();
         String selectId = dataTable.getAttribute("id") + "Select";
         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"));
         Map<String, String> emptyAttributes = CollectionUtils.newHashMap();
         addSelectItems(select, StaticFacesUtils.wrapExpression(controllerName + "Bean.all"), emptyAttributes);
         panelGrid.getChildren().add(select);

         // Create 'Add' button

         HtmlCommandLink addLink = new HtmlCommandLink();
         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)
                  + "'); return false; }");

         // (id is useful for unit tests)

         addLink.putAttribute("id", dataTable.getAttribute("id") + "Add");
         panelGrid.getChildren().add(addLink);

         panelGroup.getChildren().add(panelGrid);
      }

      return panelGroup;
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.layout.HtmlPanelGrid

      // If not bidirectional, create an 'Add' section (bidirectional does it 'in place')

      if (!attributes.containsKey(INVERSE_RELATIONSHIP))
      {
         HtmlPanelGrid panelGrid = new HtmlPanelGrid();
         panelGrid.putAttribute("styleClass", "data-table-footer");
         panelGrid.putAttribute("columns", "2");
         panelGrid.putAttribute("columnClasses", ",remove-column");

         // Select menu at bottom

         HtmlSelectOneMenu select = new HtmlSelectOneMenu();
         String selectId = dataTable.getAttribute("id") + "Select";
         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);

         // Create 'Add' button

         HtmlCommandLink addLink = new HtmlCommandLink();
         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)
                  + "'); return false; }");

         // (id is useful for unit tests)

         addLink.putAttribute("id", dataTable.getAttribute("id") + "Add");
         panelGrid.getChildren().add(addLink);

         panelGroup.getChildren().add(panelGrid);
      }

      return panelGroup;
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.layout.HtmlPanelGrid

      // If not bidirectional, create an 'Add' section (bidirectional does it 'in place')

      if (!attributes.containsKey(INVERSE_RELATIONSHIP))
      {
         HtmlPanelGrid panelGrid = new HtmlPanelGrid();
         panelGrid.putAttribute("styleClass", "data-table-footer");
         panelGrid.putAttribute("columns", "2");
         panelGrid.putAttribute("columnClasses", ",remove-column");

         // Select menu at bottom

         HtmlSelectOneMenu select = new HtmlSelectOneMenu();
         String selectId = dataTable.getAttribute("id") + "Select";
         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);

         // Create 'Add' button

         HtmlCommandLink addLink = new HtmlCommandLink();
         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)
                  + "'); return false; }");

         // (id is useful for unit tests)

         addLink.putAttribute("id", dataTable.getAttribute("id") + "Add");
         panelGrid.getChildren().add(addLink);

         panelGroup.getChildren().add(panelGrid);
      }

      return panelGroup;
View Full Code Here

Examples of org.metawidget.statically.faces.component.html.layout.HtmlPanelGrid

      // If not bidirectional, create an 'Add' section (bidirectional does it 'in place')

      if (!attributes.containsKey(INVERSE_RELATIONSHIP))
      {
         HtmlPanelGrid panelGrid = new HtmlPanelGrid();
         panelGrid.putAttribute("styleClass", "data-table-footer");
         panelGrid.putAttribute("columns", "2");
         panelGrid.putAttribute("columnClasses", ",remove-column");

         // Select menu at bottom

         HtmlSelectOneMenu select = new HtmlSelectOneMenu();
         String selectId = dataTable.getAttribute("id") + "Select";
         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"));
         Map<String, String> emptyAttributes = CollectionUtils.newHashMap();
         addSelectItems(select, StaticFacesUtils.wrapExpression(controllerName + "Bean.all"), emptyAttributes);
         panelGrid.getChildren().add(select);

         // Create 'Add' button

         HtmlCommandLink addLink = new HtmlCommandLink();
         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)
                  + "'); return false; }");

         // (id is useful for unit tests)

         addLink.putAttribute("id", dataTable.getAttribute("id") + "Add");
         panelGrid.getChildren().add(addLink);

         panelGroup.getChildren().add(panelGrid);
      }

      return panelGroup;
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.