Package org.openfaces.component.table

Examples of org.openfaces.component.table.ColumnVisibilityMenu


import java.util.List;

public class ColumnVisibilityMenuRenderer extends PopupMenuRenderer {
    @Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        ColumnVisibilityMenu cvm = (ColumnVisibilityMenu) component;
        updateMenuItems(context, cvm);
        super.encodeBegin(context, component);
    }
View Full Code Here


    }

    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        super.encodeEnd(context, component);
        ColumnVisibilityMenu cvm = (ColumnVisibilityMenu) component;
        AbstractTable table = getTable(cvm);
        final List<BaseColumn> allColumns = table.getAllColumns();
        final List<String> allColumnsIds = new ArrayList<String>(allColumns.size());
        for (BaseColumn each : allColumns) {
            allColumnsIds.add(each.getId());
        }
        Rendering.renderInitScript(context, new ScriptBuilder().initScript(context,
                component, "O$.ColumnMenu._initColumnVisibilityMenu", table, allColumnsIds),
                AbstractTableRenderer.getTableJsURL(context));
        cvm.getChildren().clear();
    }
View Full Code Here

            menuItems.add(Components.createComponent(context, GroupByColumnMenuItem.COMPONENT_TYPE, GroupByColumnMenuItem.class, menu, "groupByColumn"));
            menuItems.add(Components.createComponent(context, RemoveFromGroupingMenuItem.COMPONENT_TYPE, RemoveFromGroupingMenuItem.class, menu, "removeFromGrouping"));
//            menuItems.add(Components.createComponent(context, CancelGroupingMenuItem.COMPONENT_TYPE, CancelGroupingMenuItem.class, menu, "cancelGrouping");
            menuItems.add(Components.createComponent(context, HideColumnMenuItem.COMPONENT_TYPE, HideColumnMenuItem.class, menu, "hideColumn"));
            menuItems.add(Components.createComponent(context, MenuSeparator.COMPONENT_TYPE, MenuSeparator.class, menu, "separator"));
            ColumnVisibilityMenu columnVisibilityMenu = Components.createComponent(context,
                    ColumnVisibilityMenu.COMPONENT_TYPE, ColumnVisibilityMenu.class, menu, "columnVisibilityMenu");
            MenuItem columns = Components.createComponent(context, MenuItem.COMPONENT_TYPE, MenuItem.class, menu, "columnsSubmenu");
            columns.setValue("Columns");
            columns.getChildren().add(columnVisibilityMenu);
            menuItems.add(columns);
View Full Code Here

TOP

Related Classes of org.openfaces.component.table.ColumnVisibilityMenu

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.