Package com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody

Examples of com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow


        private void updateDropDetails(VDragEvent drag) {
            dropDetails = new TableDDDetails();
            Element elementOver = drag.getElementOver();

            VScrollTableRow row = Util.findWidget(elementOver, getRowClass());
            if (row != null) {
                dropDetails.overkey = row.rowKey;
                Element tr = row.getElement();
                Element element = elementOver;
                while (element != null && element.getParentElement() != tr) {
                    element = (Element) element.getParentElement();
                }
                int childIndex = DOM.getChildIndex(tr, element);
                dropDetails.colkey = tHead.getHeaderCell(childIndex)
                        .getColKey();
                dropDetails.dropLocation = DDUtil.getVerticalDropLocation(row
                        .getElement(), drag.getCurrentGwtEvent().getClientY(),
                        0.2);
            }

            drag.getDropDetails().put("itemIdOver", dropDetails.overkey + "");
View Full Code Here


            UIObject.setStyleName(getElement(), CLASSNAME + "-drag", false);
            if (lastEmphasized == null) {
                return;
            }
            for (Widget w : scrollBody.renderedRows) {
                VScrollTableRow row = (VScrollTableRow) w;
                if (lastEmphasized != null
                        && row.rowKey == lastEmphasized.overkey) {
                    if (row != null) {
                        String stylename = ROWSTYLEBASE
                                + lastEmphasized.dropLocation.toString()
                                        .toLowerCase();
                        VScrollTableRow.setStyleName(row.getElement(),
                                stylename, false);
                    }
                    lastEmphasized = null;
                    return;
                }
View Full Code Here

        private void emphasis(TableDDDetails details) {
            deEmphasis();
            UIObject.setStyleName(getElement(), CLASSNAME + "-drag", true);
            // iterate old and new emphasized row
            for (Widget w : scrollBody.renderedRows) {
                VScrollTableRow row = (VScrollTableRow) w;
                if (details != null && details.overkey == row.rowKey) {
                    if (row != null) {
                        String stylename = ROWSTYLEBASE
                                + details.dropLocation.toString().toLowerCase();
                        VScrollTableRow.setStyleName(row.getElement(),
                                stylename, true);
                    }
                    lastEmphasized = details;
                    return;
                }
View Full Code Here

                // FIXME should focus first visible from top, not first rendered
                // ??
                return setRowFocus((VScrollTableRow) scrollBody.iterator()
                        .next());
            } else {
                VScrollTableRow next = getNextRow(focusedRow, offset);
                if (next != null) {
                    return setRowFocus(next);
                }
            }
        }
View Full Code Here

                // FIXME logic is exactly the same as in moveFocusDown, should
                // be the opposite??
                return setRowFocus((VScrollTableRow) scrollBody.iterator()
                        .next());
            } else {
                VScrollTableRow prev = getPreviousRow(focusedRow, offset);
                if (prev != null) {
                    return setRowFocus(prev);
                } else {
                    VConsole.log("no previous available");
                }
View Full Code Here

            // clean selectedRowKeys so that they don't contain excess values
            for (Iterator<String> iterator = selectedRowKeys.iterator(); iterator
                    .hasNext();) {
                String key = iterator.next();
                VScrollTableRow renderedRowByKey = getRenderedRowByKey(key);
                if (renderedRowByKey != null) {
                    for (SelectionRange range : selectedRowRanges) {
                        if (range.inRange(renderedRowByKey)) {
                            iterator.remove();
                        }
View Full Code Here

        // If a row had an open context menu before the update, and after the
        // update there's a row with the same key as that row, restore the
        // context menu. See #8526.
        if (enabled && savedContextMenu != null) {
            for (Widget w : scrollBody.renderedRows) {
                VScrollTableRow row = (VScrollTableRow) w;
                if (row.isVisible()
                        && row.getKey().equals(savedContextMenu.rowKey)) {
                    row.showContextMenu(savedContextMenu.left,
                            savedContextMenu.top);
                    break;
                }
            }
        }
View Full Code Here

                while (iterator.hasNext()) {
                    /*
                     * Make the focus reflect to the server side state unless we
                     * are currently selecting multiple rows with keyboard.
                     */
                    VScrollTableRow row = (VScrollTableRow) iterator.next();
                    boolean selected = selectedKeys.contains(row.getKey());
                    boolean changedOnServerSide = changedSelectedKeys
                            .contains(row.getKey());
                    if (!selected
                            && unSyncedselectionsBeforeRowFetch != null
                            && unSyncedselectionsBeforeRowFetch.contains(row
                                    .getKey())) {
                        selected = true;
                        keyboardSelectionOverRowFetchInProgress = true;
                    } else if (selected != row.isSelected()
                            && !changedOnServerSide) {
                        // ensure the previous selection doesn't override a
                        // selection made on client side on an update that
                        // arrives before server side has been updated (see
                        // #6684)
                        selected = !selected;
                    }
                    if (selected != row.isSelected()) {
                        row.toggleSelection();
                        if (!isSingleSelectMode() && !selected) {
                            // Update selection range in case a row is
                            // unselected from the middle of a range - #8076
                            removeRowFromUnsentSelectionRanges(row);
                        }
View Full Code Here

    private void focusRowFromBody() {
        if (selectedRowKeys.size() == 1) {
            // try to focus a row currently selected and in viewport
            String selectedRowKey = selectedRowKeys.iterator().next();
            if (selectedRowKey != null) {
                VScrollTableRow renderedRow = getRenderedRowByKey(selectedRowKey);
                if (renderedRow == null || !renderedRow.isInViewPort()) {
                    setRowFocus(scrollBody.getRowByRowIndex(firstRowInViewPort));
                } else {
                    setRowFocus(renderedRow);
                }
            }
View Full Code Here

            firstRendered = firstIndex;
            setLastRendered(firstIndex + rows - 1);
            final Iterator<?> it = rowData.getChildIterator();
            aligns = tHead.getColumnAlignments();
            while (it.hasNext()) {
                final VScrollTableRow row = createRow((UIDL) it.next(), aligns);
                addRow(row);
            }
            if (isAttached()) {
                fixSpacers();
            }
View Full Code Here

TOP

Related Classes of com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow

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.