Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlPanelGroup


      int maximum,  // nombre maxim de digits o chars
      ArrayList<String> renderList,
      ArrayList<String> executeList)
  {

    HtmlPanelGroup panelGroup1 = new HtmlPanelGroup();
    panelGroup1.setTransient(true);
   
    HtmlPanelGrid panelGrid1 = new HtmlPanelGrid();
    panelGrid1.setTransient(true);
   
    panelGrid1.setColumns(2);
    panelGrid1.setStyle("style='vertical-align: top'");
   
    HtmlPanelGroup panelGroup2 = new HtmlPanelGroup();
    panelGroup2.setTransient(true);
   
    HtmlPanelGrid panelGrid2 = new HtmlPanelGrid();
    panelGrid2.setTransient(true);
   
    panelGrid2.setColumns(1);
   
    /** BUTO GE **/
      UICommandLink clGE = buildCommandLinkRich(
          "GE_" + nomColumna,
          null,
          renderList ,
          executeList);
     
      ValueExpression vGE = (ValueExpression) Utils.resolveExpression("/images/ElementPlus.jpg");
      HtmlGraphicImage giGE = buildGraphicImage(
          "GE_" + nomColumna,
          vGE,
          "Mayor que");
     
      clGE.getChildren().add(giGE);
     
      // setPropertyBean (ge = greater or equal,...)
      clGE.addActionListener(setPropertyActionListener(
            valueExpressionOperadors,
            "ge",
            String.class));
     
      panelGrid2.getChildren().add(clGE);
    /*************************/
   
   
    /** BUTO LE **/
      UICommandLink clLE = buildCommandLinkRich(
              "LE_" + nomColumna,
              null,
              renderList ,
              executeList);
     
      ValueExpression vLE = (ValueExpression) Utils.resolveExpression("/images/ElementMinus.jpg");
      HtmlGraphicImage giLE = buildGraphicImage(
              "LE_" + nomColumna,
              vLE,
              "Menor que");
     
      clLE.getChildren().add(giLE);
     
      // setPropertyBean (ge = greater or equal,...)
      clLE.addActionListener(setPropertyActionListener(
              valueExpressionOperadors,
              "le",
              String.class));
     
      panelGrid2.getChildren().add(clLE);
    /*************************/
   
    panelGroup2.getChildren().add(panelGrid2);

    HtmlPanelGroup panelGroup3 = new HtmlPanelGroup();
    panelGroup3.setTransient(true);
   
    HtmlPanelGrid panelGrid3 = new HtmlPanelGrid();
    panelGrid3.setTransient(true);
    panelGrid3.setColumns(1);
   

    ValueExpression vFiltre =  (ValueExpression) Utils.resolveExpression(valueExpressionFiltre);
   
    HtmlInputText it = buildInputText(
        "butoneraNumerica_it_" + idColumna ,
        vFiltre,
        "width:50px",
        20,
        "", // requiredMessage
        ""// messageConverter
        tipusColumna,
        false,
        true, // transient !!!!!!!!
        minimum,
        maximum);        
    afegirAjax(
        it,
        "blur",
        renderList,
        executeList);
     

    panelGrid3.getChildren().add(it);
   
    panelGroup3.getChildren().add(panelGrid3);
   
    panelGrid1.getChildren().add(panelGroup2);
    panelGrid1.getChildren().add(panelGroup3);
   
    panelGroup1.getChildren().add(panelGrid1);
View Full Code Here


        Collection<String> value = new ArrayList<String>();
        value.add("value#1");
        value.add("value#2");
        uidata.setValue(value);
        // header facet
        UIComponent headerFacet = new HtmlPanelGroup();
        headerFacet.setId("headerFacet");
        uidata.setHeader(headerFacet);
        // footer facet
        UIComponent footerFacet = new HtmlPanelGroup();
        footerFacet.setId("footerFacet");
        uidata.setFooter(footerFacet);
        // first child
        UIComponent child1 = new UIColumn();
        // facet of first child
        UIComponent facetOfChild1 = new HtmlPanelGroup();
        child1.getFacets().put("someFacet", facetOfChild1);
        // child of first child
        UIOutput childOfChild1 = new UIOutput();
        childOfChild1.setId("childOfColumn");
        child1.getChildren().add(childOfChild1);
        uidata.getChildren().add(child1);
        // second child (should not be processed --> != UIColumn)
        UIComponent child2 = new HtmlPanelGroup();
        uidata.getChildren().add(child2);
        VisitCallback callback = null;
       
        IMocksControl control = EasyMock.createControl();
        VisitContext visitContextMock = control.createMock(VisitContext.class);
View Full Code Here

public UIComponent makeInputComponent(UiContext context,
                                      Section section,
                                      Parameter parameter) {
  // initialize the panel
  HtmlPanelGroup panel = new HtmlPanelGroup();
  String sIdPfx = getFacesId();
  panel.setId(sIdPfx);
 
  // add input text components based upon the array size
  ContentValues values = parameter.getContent().getMultipleValues();
  for (int i=0;i<getArraySize();i++) {
    HtmlInputText component = new HtmlInputText();
    String sId = sIdPfx+"-v"+i;
    component.setId(sId);
    component.setMaxlength(getMaxlength());
    component.setSize(getSize());
    component.setDisabled(!getEditable());
    component.setOnchange(getOnChange());
    component.setOnclick(getOnClick());
    component.setValue("");
    if (i < values.size()) {
      component.setValue(Val.chkStr(values.get(i).getValue()));
    }
    panel.getChildren().add(applyHint(context,component));
    panel.getChildren().add(makeBR());
  }
  return panel;
}
View Full Code Here

                                      Section section,
                                      Parameter parameter) {
 
  // make the component
  MessageBroker msgBroker = context.extractMessageBroker();
  HtmlPanelGroup panel = new HtmlPanelGroup();
 
  // make the map tools
  HtmlPanelGroup toolbar = new HtmlPanelGroup();
  toolbar.setId("mapToolbar");
  toolbar.setStyleClass("mapToolbar");
  panel.getChildren().add(toolbar);
 
  HtmlGraphicImage btn;
  String sMsg;
 
  btn = new HtmlGraphicImage();
  sMsg = msgBroker.retrieveMessage("catalog.general.map.zoomToWorld");
  btn.setId("mapButton-zoomToWorld");
  btn.setAlt(sMsg);
  btn.setTitle(sMsg);
  btn.setUrl("/catalog/images/btn-zoomToWorld-off.gif");
  toolbar.getChildren().add(btn);
 
  btn = new HtmlGraphicImage();
  sMsg = msgBroker.retrieveMessage("catalog.general.map.zoomToInputEnvelope");
  btn.setId("mapButton-zoomToInputEnvelope");
  btn.setAlt(sMsg);
  btn.setTitle(sMsg);
  btn.setUrl("/catalog/images/btn-zoomToInputEnvelope-off.gif");
  toolbar.getChildren().add(btn);
   
  btn = new HtmlGraphicImage();
  sMsg = msgBroker.retrieveMessage("catalog.general.map.drawInputEnvelope");
  btn.setId("mapTool-drawInputEnvelope");
  btn.setAlt(sMsg);
  btn.setTitle(sMsg);
  btn.setStyleClass("firstTool");
  btn.setUrl("/catalog/images/btn-drawInputEnvelope-off.gif");
  toolbar.getChildren().add(btn);
 
  btn = new HtmlGraphicImage();
  sMsg = msgBroker.retrieveMessage("catalog.general.map.deactivate");
  btn.setId("mapTool-deactivate");
  btn.setAlt(sMsg);
  btn.setTitle(sMsg);
  btn.setUrl("/catalog/images/btn-deactivate-off.gif");
  toolbar.getChildren().add(btn);
 
  HtmlInputText text = new HtmlInputText();
  text.setId("mapInput-locate");
  text.setStyleClass("locatorInput");
  text.setMaxlength(1024);
  text.setOnkeypress("return mdeMap.onLocatorKeyPress(event);");
  toolbar.getChildren().add(text);
 
  btn = new HtmlGraphicImage();
  sMsg = msgBroker.retrieveMessage("catalog.general.map.locate");
  btn.setId("mapButton-locate");
  btn.setAlt(sMsg);
  btn.setTitle(sMsg);
  btn.setUrl("/catalog/images/btn-locate-off.gif");
  toolbar.getChildren().add(btn);
 
  // make the map component
  StringBuffer sb = new StringBuffer();
  String sMapId = "interactiveMap";
  String sMapWH = "width:"+getWidth()+"px; height:"+getHeight()+"px;";
View Full Code Here

                                       Section section,
                                       Parameter parameter) {
 
  // make the component
  MessageBroker msgBroker = context.extractMessageBroker();
  HtmlPanelGroup panel = new HtmlPanelGroup();
 
  // make the map tools
  HtmlPanelGroup toolbar = new HtmlPanelGroup();
  toolbar.setId("mapToolbar");
  toolbar.setStyleClass("mapToolbar");
  panel.getChildren().add(toolbar);
 
  HtmlGraphicImage btn;
  String sMsg;
   
  btn = new HtmlGraphicImage();
  sMsg = msgBroker.retrieveMessage("catalog.general.map.zoomToInputEnvelope");
  btn.setId("mapButton-zoomToInputEnvelope");
  btn.setAlt(sMsg);
  btn.setTitle(sMsg);
  btn.setUrl("/catalog/images/btn-zoomToInputEnvelope-off.gif");
  toolbar.getChildren().add(btn);
 
  // make the map component
  StringBuffer sb = new StringBuffer();
  String sMapId = "interactiveMap";
  String sMapWH = "width:"+getWidth()+"px; height:"+getHeight()+"px;";
View Full Code Here

     
    } else if (this.getHintMode().equalsIgnoreCase("toggle")) {
     
      // toggled hint (icon to open/close an element containing the hint)
     
      HtmlPanelGroup panel = new HtmlPanelGroup();
      panel.getChildren().add(inputComponent);
     
      HtmlOutputText space = new HtmlOutputText();
      space.setEscape(false);
      space.setValue("&nbsp;");
      panel.getChildren().add(space);
     
      HtmlGraphicImage img = new HtmlGraphicImage();
      img.setStyleClass("hintIcon");
      img.setUrl("/catalog/images/hint.gif");
      img.setOnclick("mdeToggleHint(this);");
      panel.getChildren().add(img);
     
      HtmlPanelGroup hintSection = new HtmlPanelGroup();
      hintSection.setStyle("display:none;");
      hintSection.setStyleClass("hintSection");
      HtmlOutputText outText = new HtmlOutputText();
      outText.setStyleClass("hint");
      outText.setEscape(false);
      outText.setValue(sHint);
      hintSection.getChildren().add(outText);
      panel.getChildren().add(hintSection);
     
      return panel;
     
    } else {
     
      // inline hint (original component + output text wrapped in a panel)
      HtmlPanelGroup panel = new HtmlPanelGroup();
      panel.getChildren().add(inputComponent);
      HtmlOutputText outText = new HtmlOutputText();
      outText.setStyleClass("hint");
      outText.setEscape(false);
      outText.setValue(" "+sHint);
      panel.getChildren().add(outText);
      return panel;
     
    }
   
  }
View Full Code Here

    component.setId(getFacesId());
    component.setValue(sValue);
   
    // handle a thumbnail
    if (parameter.getMeaningType().equalsIgnoreCase(Meaning.MEANINGTYPE_THUMBNAIL_URL)) {
      HtmlPanelGroup panel = new HtmlPanelGroup();
      panel.getChildren().add(component);
      panel.getChildren().add(makeBR());
      HtmlGraphicImage img = new HtmlGraphicImage();
      img.setUrl(sValue);
      img.setStyle("border: 1px solid silver");
      panel.getChildren().add(img);
      return panel;
     
    } else {
     
      // activate URL links (make sure to escape if turning JSF escaping off)
View Full Code Here

  String sBodyId = sSectionId+"-body";
  String sParamsId = sSectionId+"-params";
  boolean bIsExclusive = getObligation().equalsIgnoreCase(Section.OBLIGATION_EXCLUSIVE);
  boolean bIsOptional = getObligation().equalsIgnoreCase(Section.OBLIGATION_OPTIONAL);
  HtmlPanelGroup panel = new HtmlPanelGroup();
  panel.setStyleClass("section");
  MessageBroker msgBroker = context.extractMessageBroker();
 
  // return if there is nothing to display
  if ((bIsExclusive || bIsOptional) && !getOpen()) {
    return false;
  }
 
  // determine the caption
  String sCaption = "";
  if (getLabel() != null) {
    sCaption = msgBroker.retrieveMessage(getLabel().getResourceKey());
  }
  if (sCaption.length() == 0) {
    sCaption = getKey();
  }
 
  // make the header
  StringBuffer sbOnclick = new StringBuffer();
  sbOnclick.append("mddOnSectionClicked('").append(sSectionId).append("')");
 
  HtmlPanelGrid headerTable = new HtmlPanelGrid();
  headerTable.setColumns(3);
  headerTable.setStyleClass("sectionHeader");
  headerTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
  headerTable.setOnclick(sbOnclick.toString());
 
  HtmlSelectBooleanCheckbox checkBox = new HtmlSelectBooleanCheckbox();
  checkBox.setId(sCheckboxId);
  checkBox.setSelected(getOpen());
  checkBox.setStyle("display:none;");
  headerTable.getChildren().add(checkBox);
 
  HtmlGraphicImage img = new HtmlGraphicImage();
  img.setId(sImgId);
  setGraphicUrl(img);
  headerTable.getChildren().add(img);
 
  HtmlOutputText caption = new HtmlOutputText();
  caption.setValue(sCaption);
  caption.setStyleClass("sectionCaption");
  headerTable.getChildren().add(caption);
  if (getLabel() != null) {
    panel.getChildren().add(headerTable);
  } else {
    panel.setStyleClass("");
  }
 
  // make the section body
  boolean bContainerOnly = (getLabel() == null);
  String sBodyClass = "sectionBody";
  if (bContainerOnly) sBodyClass= "";
  HtmlPanelGrid sectionBody = new HtmlPanelGrid();
  sectionBody.setId(sBodyId);
  sectionBody.setStyleClass(sBodyClass);
  setBodyDisplay(sectionBody);
  panel.getChildren().add(sectionBody);
 
  // make the table to hold section parameters, add all parameters
  HtmlPanelGrid parametersTable = new HtmlPanelGrid();
  parametersTable.setId(sParamsId);
  parametersTable.setColumns(2);
  parametersTable.setStyleClass("parameters");
  parametersTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
  boolean hasMap = false;
  for (Parameter parameter: getParameters().values()) {
    HtmlOutputText cmpLabel = null;
    UIComponent cmpValue = null;
   
    // check for a binary thumbnail
    if (parameter.getMeaningType().equalsIgnoreCase(Meaning.MEANINGTYPE_THUMBNAIL_URL)) {
      if (schema.getMeaning().getThumbnailUrl().length() == 0) {
        String uuid = Val.chkStr(context.extractHttpServletRequest().getParameter("uuid"));
        if ((uuid.length() > 0) && (schema.getMeaning().getThumbnailBinary().length() > 0)) {
          try {
            String thumbUrl = "/thumbnail?uuid="+URLEncoder.encode(uuid,"UTF-8");
            parameter.getContent().getSingleValue().setValue(thumbUrl);
          } catch (UnsupportedEncodingException e) {}
        }
      }
    }
   
    boolean bDisplay = parameter.getVisible() && parameter.getVisibleOnDetails() &&
                       !parameter.getContent().isValueEmpty() &&
                       (parameter.getInput() != null);
    if ((parameter.getInput() instanceof InputMap)) {
      cmpValue = parameter.getInput().makeOutputComponent(context,this,parameter);
      if (cmpValue != null) {
        parametersTable.getChildren().add(cmpValue);
        hasMap = true;
      }
    } else if (bDisplay) {
      cmpValue = parameter.getInput().makeOutputComponent(context,this,parameter);
      if (cmpValue != null) {
        cmpLabel = new HtmlOutputText();
        cmpLabel.setValue(msgBroker.retrieveMessage(parameter.getLabel().getResourceKey()));
        parametersTable.getChildren().add(cmpLabel);
        parametersTable.getChildren().add(cmpValue);
      }
    }
  }
  parametersTable.setColumnClasses(hasMap? ",parameterValue": "parameterLabel,parameterValue");
  if (parametersTable.getChildCount() > 0) {
    bHadParameters = true;
    sectionBody.getChildren().add(parametersTable);
  }
 
  // append all sub-sections
  for (Section section: getSections().values()) {
    boolean bHadSubParams = section.appendDetailComponents(schema,context,sectionBody);
    if (bHadSubParams) bHadParameters = true;
  }
  if (!bHadParameters) panel.setRendered(false);
  if ((panel != null) && (panel.getChildCount() > 0) && panel.isRendered()) {
    parentComponent.getChildren().add(panel);
  }
 
  return bHadParameters;
}
View Full Code Here

  String sBodyId = sSectionId+"-body";
  String sParamsId = sSectionId+"-params";
  boolean bIsExclusive = getObligation().equalsIgnoreCase(Section.OBLIGATION_EXCLUSIVE);
  boolean bIsOptional = getObligation().equalsIgnoreCase(Section.OBLIGATION_OPTIONAL);
 
  HtmlPanelGroup panel = new HtmlPanelGroup();
  panel.setStyleClass("section");
  MessageBroker msgBroker = context.extractMessageBroker();
 
  // determine the caption
  String sCaption = "";
  if (getLabel() != null) {
    sCaption = msgBroker.retrieveMessage(getLabel().getResourceKey());
  }
  if (sCaption.length() == 0) {
    sCaption = getKey();
  }
 
  StringBuffer sbOnclick = new StringBuffer();
  sbOnclick.append("mdeOnSectionClicked(");
  sbOnclick.append("this,").append(bIsOptional).append(",").append(bIsExclusive);
  sbOnclick.append(",'").append(sSectionId).append("')");
 
  // add the caption
  if (bIsExclusive) {
   
    Sections exclusive = getExclusiveSiblings(schema);
    boolean bIsFirstExclusive = (exclusive.size() > 0) &&
                                (this == exclusive.values().iterator().next());
    if (bIsFirstExclusive) {
      HtmlSelectOneRadio radio = new HtmlSelectOneRadio();
      radio.setId(sRadioId);
      radio.setStyleClass("optionalSectionHeader");
      radio.setOnclick(sbOnclick.toString());
      ArrayList<SelectItem> radioItems = new ArrayList<SelectItem>();
      UISelectItems uiItems = new UISelectItems();
      uiItems.setValue(radioItems);
      radio.getChildren().add(uiItems);
      panel.getChildren().add(radio);
      int nIdx = 0;
      for (Section sibling: exclusive.values()) {
        String sItemLabel = "";
        String sItemId = sibling.getFacesId();
        if (sibling.getLabel() != null) {
          sItemLabel = msgBroker.retrieveMessage(sibling.getLabel().getResourceKey());
        }
        if (sItemLabel.length() == 0) {
          sItemLabel = sibling.getKey();
        }
        radioItems.add(new SelectItem(sItemId,sItemLabel));
        if (sibling.getOpen()) {
          radio.setValue(sItemId);
        }
        nIdx++;
      }
    }
   
  } else if (bIsOptional) { 
   
    HtmlPanelGroup captionPanel = new HtmlPanelGroup();
    captionPanel.setStyleClass("optionalSectionHeader");
   
    HtmlPanelGrid headerTable = new HtmlPanelGrid();
    headerTable.setColumns(2);
    headerTable.setStyleClass("optionalSectionHeader");
    headerTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
View Full Code Here

  parameter.getContent().getSingleValue().setValue(sValue);
 

 
  // group the components
  HtmlPanelGroup panel = new HtmlPanelGroup();
  panel.getChildren().add(menu);
  panel.getChildren().add(makeNBSP());
  panel.getChildren().add(text);
  return panel;
}
View Full Code Here

TOP

Related Classes of javax.faces.component.html.HtmlPanelGroup

Copyright © 2018 www.massapicom. 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.