Package org.richfaces.model.selection

Examples of org.richfaces.model.selection.SimpleSelection


            // state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
            Object savedKey = table.getRowKey();

            final TableHolder holder = new TableHolder(table);

            final SimpleSelection simpleSelection = table.getSelection() == null ? new SimpleSelection()
                    : (SimpleSelection) table.getSelection();

            if (clientSelection.isReset() || clientSelection.isSelectAll()) {
                simpleSelection.clear();
            }

            try {
                table.walk(context, new DataVisitor() {
                    public void process(FacesContext context, Object rowKey,
                            Object argument) throws IOException {

                        // TableHolder holder = (TableHolder) argument;
                        // int i = state.getRowIndex();
                        int i = holder.getRowCounter();

                        if (shouldAddToSelection(i, oldClientSelection,
                                clientSelection)) {

                            simpleSelection.addKey(rowKey);

                        } else if (shouldRemoveFromSelection(i,
                                oldClientSelection, clientSelection)) {

                            simpleSelection.removeKey(rowKey);

                        }

                        if (i == clientSelection.getActiveRowIndex()) {
                            table.setActiveRowKey(rowKey);
View Full Code Here


        // state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
      Object savedKey = table.getRowKey();

        final TableHolder holder = new TableHolder(table);

        final Selection gridSelection = table.getSelection() == null ? new SimpleSelection()
                : table.getSelection();
        final ClientSelection clientSelection = new ClientSelection();

        table.walk(context, new DataVisitor() {
            public void process(FacesContext context, Object rowKey,
View Full Code Here

      final ClientSelection clientSelection = (ClientSelection) converter
          .getAsObject(context, grid, value);
      final ScrollableDataTableRendererState state = ScrollableDataTableRendererState
          .createState(context, grid);
      state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
      final SimpleSelection simpleSelection = grid.getSelection() == null ? new SimpleSelection()
          : (SimpleSelection) grid.getSelection();
      if (clientSelection.isReset() || clientSelection.isSelectAll()) {
        simpleSelection.clear();
        simpleSelection.setSelectAll(clientSelection.isSelectAll());
      }
      try {
        grid.walk(context, new DataVisitor() {
          public void process(FacesContext context, Object rowKey,
              Object argument) throws IOException {

            int i = state.getRowIndex();

            if (shouldAddToSelection(i, oldClientSelection,
                clientSelection)) {

              simpleSelection.addKey(rowKey);

            } else if (shouldRemoveFromSelection(i,
                oldClientSelection, clientSelection)) {

              simpleSelection.removeKey(rowKey);

            }

            if (i == clientSelection.getActiveRowIndex()) {
              grid.setActiveRowKey(rowKey);
View Full Code Here

   
    state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
   
    final Selection gridSelection =
      grid.getSelection() == null ?
          new SimpleSelection() :
            grid.getSelection();
    final ClientSelection clientSelection = new ClientSelection();
   
    grid.walk(context,
      new DataVisitor() {
View Full Code Here

    final ScrollableDataTableRendererState state =
      ScrollableDataTableRendererState.createState(context, grid);
   
    state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
   
    final SimpleSelection simpleSelection = grid.getSelection() == null ? new SimpleSelection()
        : (SimpleSelection) grid.getSelection();

   
   
    if (clientSelection.isReset() || clientSelection.isSelectAll()) {
      simpleSelection.clear();
      simpleSelection.setSelectAll(clientSelection.isSelectAll());
    }
   
    try {
      grid.walk(context,
          new DataVisitor() {
            public void process(FacesContext context, Object rowKey,
                Object argument) throws IOException {
           
              int i = state.getRowIndex();
             
              if (shouldAddToSelection(i, oldClientSelection, clientSelection)) {
               
                simpleSelection.addKey(rowKey);
             
              } else if (shouldRemoveFromSelection(i, oldClientSelection, clientSelection)){
               
                simpleSelection.removeKey(rowKey);
             
              }
             
              if(i == clientSelection.getActiveRowIndex()) {
                grid.setActiveRowKey(rowKey);
View Full Code Here

   
    state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
   
    final Selection gridSelection =
      grid.getSelection() == null ?
          new SimpleSelection() :
            grid.getSelection();
    final ClientSelection clientSelection = new ClientSelection();
   
    grid.walk(context,
      new DataVisitor() {
View Full Code Here

            // ScrollableDataTableRendererState.createState(context, grid);
            // state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));

            final TableHolder holder = new TableHolder(table);

            final SimpleSelection simpleSelection = table.getSelection() == null ? new SimpleSelection()
                    : (SimpleSelection) table.getSelection();

            if (clientSelection.isReset() || clientSelection.isSelectAll()) {
                simpleSelection.clear();
            }

            try {
                table.walk(context, new DataVisitor() {
                    public void process(FacesContext context, Object rowKey,
                            Object argument) throws IOException {

                        // TableHolder holder = (TableHolder) argument;
                        // int i = state.getRowIndex();
                        int i = holder.getRowCounter();

                        if (shouldAddToSelection(i, oldClientSelection,
                                clientSelection)) {

                            simpleSelection.addKey(rowKey);

                        } else if (shouldRemoveFromSelection(i,
                                oldClientSelection, clientSelection)) {

                            simpleSelection.removeKey(rowKey);

                        }

                        if (i == clientSelection.getActiveRowIndex()) {
                            table.setActiveRowKey(rowKey);
View Full Code Here

        // ScrollableDataTableRendererState.createState(context, grid);
        // state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));

        final TableHolder holder = new TableHolder(table);

        final Selection gridSelection = table.getSelection() == null ? new SimpleSelection()
                : table.getSelection();
        final ClientSelection clientSelection = new ClientSelection();

        table.walk(context, new DataVisitor() {
            public void process(FacesContext context, Object rowKey,
View Full Code Here

   */
  public void processSort(SortEvent e) {
    UIScrollableDataTable grid = (UIScrollableDataTable) e.getComponent();
   
    //fix https://jira.jboss.org/jira/browse/RF-4368
    SimpleSelection selection = (SimpleSelection) grid.getSelection();
    if (selection != null) {
      selection.clear();
    }
   
    String sortColumn = e.getSortColumn();

    UIComponent column = grid.findComponent(sortColumn);
View Full Code Here

   */
  public void processSort(SortEvent e) {
    UIScrollableDataTable grid = (UIScrollableDataTable) e.getComponent();
   
    //fix https://jira.jboss.org/jira/browse/RF-4368
    SimpleSelection selection = (SimpleSelection) grid.getSelection();
    if (selection != null) {
      selection.clear();
    }
   
    String sortColumn = e.getSortColumn();

    UIComponent column = grid.findComponent(sortColumn);
View Full Code Here

TOP

Related Classes of org.richfaces.model.selection.SimpleSelection

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.