Examples of UIColumn


Examples of javax.faces.component.UIColumn

    this.first = first;
  }

  public void updateSortState(SortActionEvent sortEvent) {

    UIColumn actualColumn = sortEvent.getColumn();

    if (actualColumn.getId().equals(sortedColumnId)) {
      ascending = !ascending;
    } else {
      ascending = true;
      sortedColumnId = actualColumn.getId();
    }
  }
View Full Code Here

Examples of javax.faces.component.UIColumn

  public void perform(SortActionEvent sortEvent) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("sorterId = {}", sortEvent.getComponent().getId());
    }
    UIColumn column = sortEvent.getColumn();
    AbstractUISheet data = (AbstractUISheet) sortEvent.getComponent();

    Object value = data.getValue();
    if (value instanceof DataModel) {
      value = ((DataModel) value).getWrappedData();
    }
    FacesContext facesContext = FacesContext.getCurrentInstance();
    SheetState sheetState = data.getSheetState(facesContext);

    Comparator actualComparator = null;

    if (value instanceof List || value instanceof Object[]) {
      String sortProperty;

      try {
        UIComponent child = getFirstSortableChild(column.getChildren());
        if (child != null) {

          String attributeName = child instanceof AbstractUICommand ? Attributes.LABEL : Attributes.VALUE;
          if (child.getValueExpression(attributeName) != null) {
            String var = data.getVar();
View Full Code Here

Examples of javax.faces.component.UIColumn

          if (component == null) {
            LOG.error("fixme: UIColumnSelector must be a LayoutComponent!"); // fixme
            index++;
            continue;
          }
          final UIColumn column = component instanceof AbstractUIColumnNode
              ? (UIColumn) component
              : (UIColumn) ((UIComponent) component).getParent();
          if (!column.isRendered()) {
            // XXX here not index++, because the widthList has only the rendered=true, todo: change it.
            continue;
          }
          if (column instanceof LayoutBox) {
            LayoutBox box = (LayoutBox) column;
View Full Code Here

Examples of javax.faces.component.UIColumn

     */
    protected boolean hasFacet(boolean header, UIComponent uiComponent)
    {
        if (uiComponent instanceof UIColumn)
        {
            UIColumn uiColumn = (UIColumn) uiComponent;
            return header ? uiColumn.getHeader() != null : uiColumn.getFooter() != null;
        }
        return false;
    }
View Full Code Here

Examples of javax.faces.component.UIColumn

            {
                //This code corrects MYFACES-1790, because HtmlColumnTag
                //has as component type javax.faces.Column, so as side
                //effect it not create HtmlColumn, it create UIColumn
                //classes.
                UIColumn column = (UIColumn) uiComponent;               
                if (isHeader)
                {
                    String headerClass = (String) column.getAttributes().get("headerClass");
                    if (headerClass != null)
                    {
                        styleClass = (String) headerClass;
                    }
                }
                else
                {
                    String footerClass = (String) column.getAttributes().get("footerClass");
                    if (footerClass != null)
                    {
                        styleClass = (String) footerClass;
                    }
                }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIColumn

  @Override
  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);

    final UIColumn column = (UIColumn) component;
    if (isPure(column)) {
      ComponentUtils.addCurrentMarkup(column, Markup.PURE);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIColumn

      try {
        ResultSetMetaData metaData = resultSet.getMetaData();
        String columns = "";
        for (int i = 1; i <= metaData.getColumnCount(); i++) {

          UIColumn column = (UIColumn) application.createComponent(UIColumn.COMPONENT_TYPE);
          String name = metaData.getColumnName(i);
          int displaySize = metaData.getColumnDisplaySize(i);

          if (i > 1) {
            columns += ";";
          }
          if (displaySize < 10) {
            columns += "1*";
          } else if (displaySize < 20) {
            columns += "2*";
          } else {
            columns += "4*";
          }
          if (metaData.getColumnType(i) == Types.INTEGER || metaData.getColumnType(i) == Types.FLOAT) {
            column.setAlign("right");
          }
          column.setLabel(name);
          String ref = "#{" + table.getVar() + "." + name + "}";
          ValueBinding binding = application.createValueBinding(ref);
          if (name.equals("NAME")) {
            UICommand command = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
            command.setRendererType("Link");
            command.setValueBinding("label", binding);
            MethodBinding action = application.createMethodBinding("#{test.select}", new Class[0]);
            command.setAction(action);
            column.getChildren().add(command);
          } else {
            UIOutput output = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
            output.setValueBinding("value", binding);
            column.getChildren().add(output);
          }
          table.getChildren().add(column);
        }

        table.setColumns(columns);
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIColumn

  }

  public void sheetSorter(ActionEvent event) {
    if (event instanceof SortActionEvent) {
      SortActionEvent sortEvent = (SortActionEvent) event;
      UIColumn column = (UIColumn) sortEvent.getColumn();

      SheetState sheetState = ((UISheet) sortEvent.getSheet()).getSheetState(FacesContext.getCurrentInstance());
      currentAddressList = addressDao.findAddresses(searchCriterion, column.getId(), sheetState.isAscending());
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UIColumn

  }

  public void sheetSorter(ActionEvent event) {
    if (event instanceof SortActionEvent) {
      SortActionEvent sortEvent = (SortActionEvent) event;
      UIColumn column = (UIColumn) sortEvent.getColumn();

      SheetState sheetState = ((UISheet) sortEvent.getSheet()).getSheetState(FacesContext.getCurrentInstance());
      currentAddressList = addressDao.findAddresses(searchCriterion, column.getId(), sheetState.isAscending());
    }
  }
View Full Code Here

Examples of org.jboss.seam.excel.ui.UIColumn

      }

      Integer columnWidth = columnWidths.get(columnIndex);
      if (columnWidth != null)
      {
         UIColumn uiColumn = new UIColumn();
         uiColumn.setStyle(CSSNames.COLUMN_WIDTH + ":" + columnWidth);
         excelWorkbook.applyColumnSettings(uiColumn);
      }

   }
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.