Package org.apache.click.control

Examples of org.apache.click.control.Column$ColumnComparator


        // Setup customers table
        table.setClass(Table.CLASS_SIMPLE);
        table.setHoverRows(true);
        table.setSortable(true);

        Column column = new Column("id");
        column.setSortable(false);
        table.addColumn(column);

        table.addColumn(new Column("name"));

        column = new Column("email");
        column.setAutolink(true);
        table.addColumn(column);

        column = new Column("age");
        column.setTextAlign("center");
        table.addColumn(column);

        column = new Column("holdings");
        column.setFormat("${0,number,#,##0.00}");
        column.setTextAlign("right");
        table.addColumn(column);

        column = new Column("active");
        column.setTextAlign("center");
        table.addColumn(column);
    }
View Full Code Here


    public TableDecorator() {
        // Setup customers table
        table.setClass(Table.CLASS_SIMPLE);

        Column column = new Column("name");
        column.setSortable(false);
        column.setDecorator(new Decorator() {
            public String render(Object row, Context context) {
                Customer customer = (Customer) row;
                String email = customer.getEmail();
                String name = customer.getName();
                return "<a href='mailto:" + email + "'>" + name + "</a>";
            }
        });
        table.addColumn(column);

        column = new Column("investments");
        column.setAutolink(true);
        table.addColumn(column);

        column = new Column("holdings");
        column.setFormat("${0,number,#,##0.00}");
        column.setTextAlign("right");
        table.addColumn(column);

        viewLink.setTitle("View customer details");

        editLink.setListener(this, "onEditClick");
        editLink.setTitle("Edit customer details");
        editLink.setParameter("referrer", "/table/table-decorator.htm");

        deleteLink.setTitle("Delete customer record");
        deleteLink.setAttribute("onclick", "return window.confirm('Are you sure you want to delete this record?');");

        column = new Column("Action");
        column.setDecorator(new Decorator() {
            public String render(Object row, Context context) {
                Customer customer = (Customer) row;
                String id = String.valueOf(customer.getId());

                viewLink.setValue(id);
View Full Code Here

        table.setSortable(true);

        table.setPaginator(new TableInlinePaginator(table));
        table.setPaginatorAttachment(Table.PAGINATOR_INLINE);

        Column column = new Column("id");
        column.setWidth("50px");
        column.setSortable(false);
        table.addColumn(column);

        column = new Column("name");
        column.setWidth("140px;");
        table.addColumn(column);

        column = new Column("email");
        column.setAutolink(true);
        column.setWidth("230px;");
        table.addColumn(column);

        column = new Column("age");
        column.setTextAlign("center");
        column.setWidth("40px;");
        table.addColumn(column);

        column = new Column("holdings");
        column.setFormat("${0,number,#,##0.00}");
        column.setTextAlign("right");
        column.setWidth("100px;");
        table.addColumn(column);
    }
View Full Code Here

    // ------------------------------------------------------------ Constructor

    public SimpleTablePage() {
        table.setClass(Table.CLASS_ITS);

        table.addColumn(new Column("id"));
        table.addColumn(new Column("name"));
        table.addColumn(new Column("email"));
        table.addColumn(new Column("investments"));
    }
View Full Code Here

        // Setup customers table
        table.setClass(Table.CLASS_SIMPLE);
        table.setPageSize(8);
        table.setShowBanner(true);

        Column column = new Column("name");
        column.setWidth("140px");
        table.addColumn(column);

        column = new Column("email");
        column.setAutolink(true);
        column.setWidth("220px");
        table.addColumn(column);

        column = new Column("holdings");
        column.setFormat("${0,number,#,##0.00}");
        column.setTextAlign("right");
        column.setWidth("100px");
        table.addColumn(column);

        column = new Column("dateJoined");
        column.setFormat("{0,date,medium}");
        column.setWidth("90px");
        table.addColumn(column);

        column = new Column("Action");
        column.setSortable(false);
        ActionLink[] links = new ActionLink[]{editLink, deleteLink};
        column.setDecorator(new LinkDecorator(table, links, "id"));
        table.addColumn(column);

        deleteLink.setAttribute("onclick", "return window.confirm('Please confirm delete');");
    }
View Full Code Here

        final List tableColumns = getColumnList();
        final List excludedColumns = getExcludedColumns();

        for (int j = 0; j < tableColumns.size(); j++) {
            Column column = (Column) tableColumns.get(j);
            if (!excludedColumns.contains(column.getName())) {
                column.renderTableHeader(buffer, getContext());
                if (j < tableColumns.size() - 1) {
                    buffer.append("\n");
                }
            }
        }
View Full Code Here

        final List tableColumns = getColumnList();
        final List excludedColumns = getExcludedColumns();

        for (int j = 0; j < tableColumns.size(); j++) {
            Column column = (Column) tableColumns.get(j);
            if (!excludedColumns.contains(column.getName())) {
                column.renderTableData(row, buffer, getContext(), rowIndex);
                if (j < tableColumns.size() - 1) {
                    buffer.append("\n");
                }
            }
        }
View Full Code Here

            for (int i = 0, size = tableColumns.size(); i < size; i++) {
                HSSFCell cell = row.createCell(i);
                cell.setCellStyle(style);

                Column column = (Column) tableColumns.get(i);
                String title = column.getHeaderTitle();
                cell.setCellValue(title);
            }
        }
    }
View Full Code Here

            Object row = table.getRowList().get(rowIndex);

            for (int columnIndex = 0, size = tableColumns.size(); columnIndex <
                size; columnIndex++) {
                HSSFCell cell = excelRow.createCell(columnIndex);
                Column column = (Column) tableColumns.get(columnIndex);
                HSSFCellStyle style = cellStyles.get(column.getName());
                if (style != null) {
                    cell.setCellStyle(style);
                }

                Object columnValue =
View Full Code Here

        pickList = new PickList("courseList", "Courses");
        pickList.addAll(studentService.getCourses(), "id", "name");
        form.add(pickList);

        // Table
        table.addColumn(new Column("id"));
        table.addColumn(new Column("name"));

        super.onInit();
    }
View Full Code Here

TOP

Related Classes of org.apache.click.control.Column$ColumnComparator

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.