name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
framework_VComboBox_createSuggestionPopup_rdh
/** * This method will create the SuggestionPopup used by the VComboBox * instance. It is invoked during the Constructor and should only be * overridden if a custom SuggestionPopup shall be used. The overriding * method cannot use any instance variables. * * @since 7.1.5 * @return SuggestionPopup instance used b...
3.26
framework_VComboBox_selectLastItem_rdh
/** * * @deprecated use {@link SuggestionPopup#selectLastItem()} instead. */ @Deprecated public void selectLastItem() { debug("VComboBox.SM: selectLastItem()"); List<MenuItem> items = getItems(); MenuItem lastItem = items.get(items.size() - 1); selectItem(lastItem); }
3.26
framework_VComboBox_setSuggestionPopupWidth_rdh
/** * Sets the suggestion pop-up's width as a CSS string. By using relative * units (e.g. "50%") it's possible to set the popup's width relative to the * ComboBox itself. * * @param suggestionPopupWidth * new popup width as CSS string, null for old default width * calculation based on items */ public void s...
3.26
framework_VComboBox_getTotalSuggestions_rdh
/** * Gets the total number of suggestions, excluding the null selection item. * * @since 8.0 * @return total number of suggestions */ public int getTotalSuggestions() { return totalSuggestions; }
3.26
framework_VComboBox_setEmptySelectionCaption_rdh
/** * Sets the empty selection caption for this VComboBox. The text is * displayed in the text input when nothing is selected. * * @param emptySelectionCaption * the empty selection caption * @since 8.0.7 */ public void setEmptySelectionCaption(String emptySelectionCaption) { this.emptySelectionCaption = empty...
3.26
framework_VComboBox_popupOpenerClicked_rdh
/** * Record that the popup opener has been clicked and the popup should be * opened on the next request. * * This handles the special case where are not filtering yet and the * selected value has changed on the server-side. See #2119. The flag is * cleared on each server reply. */ public void popupOpenerClicked...
3.26
framework_VComboBox_handleMouseDownEvent_rdh
/** * Handles special behavior of the mouse down event. * * @param event */ private void handleMouseDownEvent(Event event) { /* Prevent the keyboard focus from leaving the textfield by preventing the default behavior of the browser. Fixes #4285. */ if (event.getTypeInt() == Event.ONMOUSEDOWN) { debug("VComboBox: ...
3.26
framework_VComboBox_setSelectionRange_rdh
/** * Overridden to avoid selecting text when text input is disabled. */ @Override public void setSelectionRange(int pos, int length) { if (f0) { /* set selection range with a backwards direction: anchor at the back, focus at the front. This means that items that are too long to display will display from ...
3.26
framework_VComboBox_execute_rdh
/** * Executes a selection of this item. */ @Override public void execute() { onSuggestionSelected(this); }
3.26
framework_VComboBox_setPagingEnabled_rdh
/** * Should paging be enabled. If paging is enabled then only a certain * amount of items are visible at a time and a scrollbar or buttons are * visible to change page. If paging is turned of then all options are * rendered into the popup menu. * * @param paging * Should the paging be turned on? */public vo...
3.26
framework_VComboBox_inputFieldKeyDown_rdh
/** * Triggered when a key is pressed in the text box * * @param event * The KeyDownEvent */ private void inputFieldKeyDown(KeyDownEvent event) { if (enableDebug) { debug(("VComboBox: inputFieldKeyDown(" + event.getNativeKeyCode()) + ")"); } switch (event.getNativeKeyCode()) { case KeyCodes.KEY_DOWN : case Ke...
3.26
framework_VComboBox_onNullSelected_rdh
/** * Triggered when an empty value is selected and null selection is allowed. */ public void onNullSelected() { if (enableDebug) { debug("VComboBox: onNullSelected()"); } dataReceivedHandler.cancelPendingPostFiltering(); currentSuggestion = null; setText(getEmptySelectionCaption()); setSelectedItemIcon(null); if ((...
3.26
framework_VComboBox_filterOptions_rdh
/** * Filters the options at certain page using the given filter. * * @param page * The page to filter * @param filter * The filter to apply to the components */ public void filterOptions(int page, String filter) { debug(((("VComboBox: filterOptions(" + page) + ", ") + filter) + ")"); if ((filter.equals(last...
3.26
framework_VComboBox_setPageLength_rdh
/** * Sets the number of items to show per page, or 0 for showing all items. * * @param pageLength * new page length or 0 for all items */ public void setPageLength(int pageLength) { this.pageLength = pageLength; }
3.26
framework_VComboBox_updatePopupPositionOnScroll_rdh
/** * Make the popup follow the position of the ComboBox when the page is * scrolled. */ private void updatePopupPositionOnScroll() { if (!scrollPending) { AnimationScheduler.get().requestAnimationFrame(timestamp -> {if (isShowing()) { leftPosition = getDesiredLeftPosition(); ...
3.26
framework_VComboBox_getMainWidth_rdh
/** * Get the width of the select in pixels where the text area and icon has * been included. * * @return The width in pixels */ private int getMainWidth() { return getOffsetWidth();}
3.26
framework_VComboBox_m4_rdh
/** * Filters the options at a certain page. Uses the text box input as a * filter and ensures the popup is opened when filtering results are * available. * * @param page * The page which items are to be filtered */ public void m4(int page) { dataReceivedHandler.popupOpenerClicked(); filterOptions(page, tb.get...
3.26
framework_VComboBox_setNextButtonActive_rdh
/** * Should the next page button be visible to the user? * * @param active */ private void setNextButtonActive(boolean active) { if (enableDebug) { debug(("VComboBox.SP: setNextButtonActive(" + active) + ")"); } if (active) { DOM.sinkEvents(down, Event.ONCLICK); down.setClassNa...
3.26
framework_VComboBox_setSelectedCaption_rdh
/** * Sets the caption of selected item, if "scroll to page" is disabled. This * method is meant for internal use and may change in future versions. * * @since 7.7 * @param selectedCaption * the caption of selected item */ public void setSelectedCaption(String selectedCaption) { explicitSelectedCaption = selec...
3.26
framework_VComboBox_setNavigationCallback_rdh
/** * Set a callback that is invoked when a page change occurs if there * have not been intervening requests to the server. The callback is * reset when any additional request is made to the server. * * @param callback * method to call after filtering has completed */ public void setNavigationCallback(Runnable...
3.26
framework_VComboBox_cancelPendingPostFiltering_rdh
/** * Cancel a pending request to perform post-filtering actions. */ private void cancelPendingPostFiltering() { pendingUserInput = null; waitingForFilteringResponse = false; }
3.26
framework_VComboBox_setText_rdh
/** * Sets the text in the text box. * * @param text * the text to set in the text box */ public void setText(final String text) {/** * To leave caret in the beginning of the line. SetSelectionRange * wouldn't work on IE (see #13477) */ Direction v91 = tb.getDirection(); tb.setDirection(Direction.RTL); tb....
3.26
framework_VComboBox_getDataReceivedHandler_rdh
/** * Returns a handler receiving notifications from the connector about * communications. * * @return the dataReceivedHandler */ public DataReceivedHandler getDataReceivedHandler() { return dataReceivedHandler; }
3.26
framework_VComboBox_createTextBox_rdh
/** * This method will create the TextBox used by the VComboBox instance. It is * invoked during the Constructor and should only be overridden if a custom * TextBox shall be used. The overriding method cannot use any instance * variables. * * @since 7.1.5 * @return TextBox instance used by this VComboBox */ pro...
3.26
framework_VComboBox_m8_rdh
/** * Sets whether creation of new items when there is no match is allowed or * not. * * @param allowNewItems * true to allow creation of new items, false to only allow * selection of existing items */ public void m8(boolean allowNewItems) { this.allowNewItems = allowNewItems; }
3.26
framework_VComboBox_updatePlaceholder_rdh
/** * Update placeholder visibility (hidden when read-only or disabled). */ public void updatePlaceholder() { if (((inputPrompt != null) && enabled) && (!readonly)) { tb.getElement().setAttribute("placeholder", inputPrompt); } else { tb.getElement().removeAttribute("placeholder"); } }
3.26
framework_VComboBox_onClick_rdh
/** * Listener for popupopener. */ @Override public void onClick(ClickEvent event) { debug("VComboBox: onClick()"); if (f0 && (event.getNativeEvent().getEventTarget().cast() == tb.getElement())) { // Don't process clicks on the text field if text input is enabled return; } if (enabled && (!readonly)) { // ask suggest...
3.26
framework_VComboBox_selectNextItem_rdh
/** * Selects the next item in the filtered selections. */ public void selectNextItem() { debug("VComboBox.SP: selectNextItem()"); final int index = menu.getSelectedIndex() + 1; if (menu.getItems().size() > index) { selectItem(menu.getItems().get(index)); } else { m5(); } }
3.26
framework_VComboBox_getSelectedCaption_rdh
/** * This method is meant for internal use and may change in future versions. * * @since 7.7 * @return the caption of selected item, if "scroll to page" is disabled */ public String getSelectedCaption() { return explicitSelectedCaption; }
3.26
framework_VComboBox_performSelection_rdh
/** * Perform selection based on a message from the server. * * The special case where the selected item is not on the current page is * handled separately by the caller. * * @param selectedKey * non-empty selected item key * @param forceUpdateText * true to force the text box value to match the suggestion...
3.26
framework_VComboBox_updateReadOnly_rdh
/** * For internal use only. May be removed or replaced in the future. */ public void updateReadOnly() { if (readonly) { suggestionPopup.hide(); } debug("VComboBox: updateReadOnly()"); tb.setReadOnly(readonly || (!f0)); }
3.26
framework_VComboBox_selectItem_rdh
/* Sets the selected item in the popup menu. */private void selectItem(final MenuItem newSelectedItem) { menu.selectItem(newSelectedItem); // Set the icon. ComboBoxSuggestion v18 = ((ComboBoxSuggestion) (newSelectedItem.getCommand())); setSelectedItemIcon(v18.getIconUri()); // Set the text. setT...
3.26
framework_VComboBox_serverReplyHandled_rdh
/** * Called by the connector when it has finished handling any reply from * the server, regardless of what was updated. */ public void serverReplyHandled() { popupOpenerClicked = false; // if (!initDone) { // debug("VComboBox: init done, updating widths"); // // Calculate minimum textarea width // updateSuggesti...
3.26
framework_VComboBox_actOnEnteredValueAfterFiltering_rdh
/** * Create/select a suggestion based on the used entered string. This * method is called after filtering has completed with the given string. * * @param enteredItemValue * user entered string */ public void actOnEnteredValueAfterFiltering(String enteredItemValue) { debug("VComboBox.SM: doPostFilterSelecte...
3.26
framework_VComboBox_getTotalSuggestionsIncludingNullSelectionItem_rdh
/** * Gets the total number of suggestions, including the possible null * selection item, if it should be visible. * * @return total number of suggestions with null selection items */ private int getTotalSuggestionsIncludingNullSelectionItem() { return getTotalSuggestions() + (getNullSelectionItemShouldBeVisibl...
3.26
framework_VComboBox_popupKeyDown_rdh
/** * Triggered when a key was pressed in the suggestion popup. * * @param event * The KeyDownEvent of the key */ private void popupKeyDown(KeyDownEvent event) {if (enableDebug) { debug(("VComboBox: popupKeyDown(" + event.getNativeKeyCode()) + ")"); } // Propagation of handled events is stopped so other handle...
3.26
framework_VComboBox_setPlaceholder_rdh
/** * Set or reset the placeholder attribute for the text field. * * @param placeholder * new placeholder string or null for none */ public void setPlaceholder(String placeholder) { inputPrompt = placeholder; updatePlaceholder(); }
3.26
framework_VComboBox_m1_rdh
/** * Perform filtering with the user entered string and when the results * are received, perform any action appropriate for the user input * (select an item or create a new one). * * @param value * user input */ public void m1(String value) {pendingUserInput = value; showPopup = false; filterOptions(0, value...
3.26
framework_VComboBox_getNullSelectionItemShouldBeVisible_rdh
/** * Returns null selection item should be visible or not. * <p> * NOTE: this checks for any entered filter value, and whether the feature * is enabled * * @since 8.0 * @return {@code true} if it should be visible, {@code } */ public boolean getNullSelectionItemShouldBeVisible() { return nullSelectionAllowed &...
3.26
framework_VComboBox_onSuggestionSelected_rdh
/** * Triggered when a suggestion is selected. * * @param suggestion * The suggestion that just got selected. */ public void onSuggestionSelected(ComboBoxSuggestion suggestion) { if (enableDebug) { debug(((("VComboBox: onSuggestionSelected(" + suggestion.caption) + ": ") + suggestion.key) + ")"); } // special h...
3.26
framework_VComboBox_updateRootWidth_rdh
/** * Calculates the width of the select if the select has undefined width. * Should be called when the width changes or when the icon changes. * <p> * For internal use only. May be removed or replaced in the future. */ public void updateRootWidth() { debug("VComboBox: updateRootWidth()"); if (connector.isUndefin...
3.26
framework_VComboBox_setPrevButtonActive_rdh
/** * Should the previous page button be visible to the user * * @param active */ private void setPrevButtonActive(boolean active) { if (enableDebug) { debug(("VComboBox.SP: setPrevButtonActive(" + active) + ")"); } if (active) { DOM.sinkEvents(up, Event.ONCLICK); up.setClassNam...
3.26
framework_VComboBox_highlightSelectedItem_rdh
/** * Highlight (select) an item matching the current text box content * without triggering its action. */ public void highlightSelectedItem() { int p = getItems().size(); // first check if there is a key match to handle items with // identical captions String currentKey = (currentSuggestion != null)...
3.26
framework_VComboBox_m5_rdh
/* Show the next page. */ private void m5() { if (hasNextPage()) { dataReceivedHandler.setNavigationCallback(() -> suggestionPopup.selectFirstItem()); filterOptions(currentPage + 1, lastFilter);} }
3.26
framework_VComboBox_reset_rdh
/** * Resets the ComboBox to its initial state. */ private void reset() { debug("VComboBox: reset()"); // just fetch selected information from state String text = connector.getState().selectedItemCaption; setText(text == null ? getEmptySelectionCaption() : text); setSelectedItemIcon(connector.getState().selectedIte...
3.26
framework_MultiSelectionEvent_getOldSelection_rdh
/** * Gets the old selection. * * @return a set of items selected before the selection was changed */ public Set<T> getOldSelection() { return Collections.unmodifiableSet(getOldValue());}
3.26
framework_MultiSelectionEvent_getNewSelection_rdh
/** * Gets the new selection. * <p> * The result is the current selection of the source * {@link AbstractMultiSelect} object. So it's always exactly the same as * {@link AbstractMultiSelect#getValue()} * * @see #getValue() * @return a set of items selected after the selection was changed */ public Set<T> getNe...
3.26
framework_MultiSelectionEvent_getRemovedSelection_rdh
/** * Gets the items that were removed from selection. * <p> * This is just a convenience method for checking what was previously * selected in {@link #getOldSelection()} but not selected anymore in * {@link #getNewSelection()}. * * @return the items that were removed from selection */ public Set<T> getRemovedS...
3.26
framework_MultiSelectionEvent_getAddedSelection_rdh
/** * Gets the items that were added to selection. * <p> * This is just a convenience method for checking what is new selected in * {@link #getNewSelection()} and wasn't selected in * {@link #getOldSelection()}. * * @return the items that were removed from selection */ public Set<T> getAddedSelection() { Linked...
3.26
framework_MultiSelectionEvent_getSource_rdh
/** * The multiselect on which the Event initially occurred. * * @return the multiselect on which the Event initially occurred. */ @Override public MultiSelect<T> getSource() { return ((MultiSelect<T>) (super.getSource())); } /** * {@inheritDoc } * <p> * This is the same as {@link #getValue()}
3.26
framework_ColorPickerGrid_getPosition_rdh
/** * Gets the position. * * @return the position */ public int[] getPosition() { return new int[]{ x, y }; }
3.26
framework_ColorPickerGrid_setValue_rdh
/** * Sets the value of this object. If the new value is not equal to * {@code getValue()}, fires a {@link ValueChangeEvent}. Throws * {@code NullPointerException} if the value is null. * * @param color * the new value, not {@code null} * @throws NullPointerException * if {@code color} is {@code null} */ @...
3.26
framework_ColorPickerGrid_setColorGrid_rdh
/** * Sets the color grid. * * @param colors * the new color grid */ public void setColorGrid(Color[][] colors) { setRowCount(colors.length);m0(colors[0].length); colorGrid = colors; for (int v10 = 0; v10 < getRows(); v10++) { for (int col = 0; col < getColumns(); col++) { ...
3.26
framework_CellReference_getColumn_rdh
/** * Gets the column objects. * * @return the column object */ public Grid.Column<?, T> getColumn() { return column; }
3.26
framework_CellReference_set_rdh
/** * Sets the identifying information for this cell. * <p> * The difference between {@link #columnIndexDOM} and {@link #columnIndex} * comes from hidden columns. * * @param columnIndexDOM * the index of the column in the DOM * @param columnIndex * the index of the column * @param column * the column o...
3.26
framework_CellReference_getRow_rdh
/** * Gets the row data object. * * @return the row object */ public T getRow() { return rowReference.getRow(); }
3.26
framework_CellReference_getColumnIndex_rdh
/** * Gets the index of the column. * <p> * <em>NOTE:</em> The index includes hidden columns in the count, unlike * {@link #getColumnIndexDOM()}. * * @return the index of the column */ public int getColumnIndex() { return columnIndex; }
3.26
framework_CellReference_getElement_rdh
/** * Get the element of the cell. * * @return the element of the cell */ public TableCellElement getElement() { return rowReference.getElement().getCells().getItem(columnIndexDOM); }
3.26
framework_CellReference_getColumnIndexDOM_rdh
/** * Gets the index of the cell in the DOM. The difference to * {@link #getColumnIndex()} is caused by hidden columns. * * @since 7.5.0 * @return the index of the column in the DOM */ public int getColumnIndexDOM() { return columnIndexDOM; }
3.26
framework_CellReference_getValue_rdh
/** * Gets the value of the cell. * * @return the value of the cell */ public Object getValue() { return getColumn().getValue(getRow()); }
3.26
framework_CellReference_getRowIndex_rdh
/** * Gets the row index of the row. * * @return the index of the row */ public int getRowIndex() { return rowReference.getRowIndex(); }
3.26
framework_Escalator_setHeight_rdh
/** * {@inheritDoc } * <p> * If Escalator is currently not in {@link HeightMode#CSS}, the given value * is remembered, and applied once the mode is applied. * * @see #setHeightMode(HeightMode) */ @Override public void setHeight(String height) { /* TODO remove method once RequiresResize and the Vaadin layoutmanag...
3.26
framework_Escalator_onScroll_rdh
/** * Logical scrolling event handler for the entire widget. */ public void onScroll() { final double scrollTop = verticalScrollbar.getScrollPos(); final double scrollLeft = horizontalScrollbar.getScrollPos(); if (lastScrollLeft != scrollLeft) { for (int i = 0; i < columnConfiguration.frozenColumns; i++) { header.upd...
3.26
framework_Escalator_updateVisibility_rdh
/** * Updates the spacer's visibility parameters, based on whether it * is being currently visible or not. */ public void updateVisibility() { if (isInViewport()) { show();} else { hide(); } }
3.26
framework_Escalator_getRowTop_rdh
/** * <em>Calculates</em> the correct top position of a row at a logical * index, regardless if there is one there or not. * <p> * A correct result requires that both {@link #getDefaultRowHeight()} is * consistent, and the placement and height of all spacers above the * given logical index are consistent. * * @...
3.26
framework_Escalator_getSpacerHeightsSumUntilIndex_rdh
/** * Gets the amount of pixels occupied by spacers until a logical row * index. * * @param logicalIndex * a logical row index * @return the pixels occupied by spacers up until {@code logicalIndex} */ @SuppressWarnings("boxing") public double getSpacerHeightsSumUntilIndex(int logicalIndex) { return getHeights(...
3.26
framework_Escalator_reapplyColumnWidths_rdh
/** * Reapplies all the cells' widths according to the calculated widths in * the column configuration. */ public void reapplyColumnWidths() { Element row = root.getFirstChildElement(); while (row != null) { // Only handle non-spacer rows if (!body.spacerContainer.isSpacer(row)) { Element cell = row.getFirstChildEle...
3.26
framework_Escalator_resetSizesFromDom_rdh
/** * Resets all cached pixel sizes and reads new values from the DOM. This * methods should be used e.g. when styles affecting the dimensions of * elements in this escalator have been changed. */public void resetSizesFromDom() { header.autodetectRowHeightNow(); body.autodetectRowHeightNow(); footer.autodetectRowHe...
3.26
framework_Escalator_paintInsertCells_rdh
/** * Inserts new cell elements into a single row element, invoking * {@link #getEscalatorUpdater()} * {@link EscalatorUpdater#preAttach(Row, Iterable) preAttach} and * {@link EscalatorUpdater#postAttach(Row, Iterable) postAttach} before * and after inserting the cells, respectively. * <p> * Precondition: The ro...
3.26
framework_Escalator_shiftSpacersByRows_rdh
/** * Shifts spacers at and after a specific row by an amount of rows. * <p> * This moves both their associated row index and also their visual * placement. * <p> * <em>Note:</em> This method does not check for the validity of any * arguments. * * @param index * the index of first row to move * @param numb...
3.26
framework_Escalator_getScrollHeight_rdh
/** * Returns the scroll height for the escalator. Note that this is not * necessary the same as {@code Element.scrollHeight} in the DOM. * * @since 7.5.0 * @return the scroll height in pixels */ public double getScrollHeight() { return verticalScrollbar.getScrollSize(); }
3.26
framework_Escalator_setHeightMode_rdh
/** * Defines the mode in which the Escalator widget's height is calculated. * <p> * If {@link HeightMode#CSS} is given, Escalator will respect the values * given via {@link #setHeight(String)}, and behave as a traditional Widget. * <p> * If {@link HeightMode#ROW} is given, Escalator will make sure that the * {@...
3.26
framework_Escalator_measureAndSetWidthIfNeeded_rdh
/** * Checks if the column needs measuring, and then measures it. * <p> * Called by {@link Escalator#onLoad()}. */ public boolean measureAndSetWidthIfNeeded() { assert isAttached() : "Column.measureAndSetWidthIfNeeded() was called even though Escalator was not attached!"; if (measuringRequested) { measuringRequeste...
3.26
framework_Escalator_getVisibleRowRange_rdh
/** * Gets the logical index range of currently visible rows. * * @return logical index range of visible rows */ public Range getVisibleRowRange() { if (!body.visualRowOrder.isEmpty()) { return Range.withLength(body.getTopRowLogicalIndex(), body.visualRowOrder.size()); } else {return Range.withLength(0, 0); } }
3.26
framework_Escalator_paintInsertRow_rdh
/** * Inserts a single row into the DOM, invoking * {@link #getEscalatorUpdater()} * {@link EscalatorUpdater#preAttach(Row, Iterable) preAttach} and * {@link EscalatorUpdater#postAttach(Row, Iterable) postAttach} before * and after inserting the row, respectively. The row should have its * cells already inserted....
3.26
framework_Escalator_removeRows_rdh
/** * {@inheritDoc } * <p> * <em>Implementation detail:</em> This method does no DOM modifications * (i.e. is very cheap to call) if there are no rows in the DOM when * this method is called. * * @see #hasSomethingInDom() */ @Override public void removeRows(final int index, final int numberOfRows) { assertArgum...
3.26
framework_Escalator_createCellElement_rdh
/** * Create and setup an empty cell element. * * @param width * the width of the cell, in pixels * @return a set-up empty cell element */ public TableCellElement createCellElement(final double width) { final TableCellElement cellElem = TableCellElement.as(DOM.createElement(getCellElementTagName())); final do...
3.26
framework_Escalator_getScrollLeft_rdh
/** * Returns the logical horizontal scroll offset. Note that this is not * necessarily the same as the {@code scrollLeft} attribute in the DOM. * * @return the logical horizontal scroll offset */ public double getScrollLeft() { return horizontalScrollbar.getScrollPos(); }
3.26
framework_Escalator_getScrollTop_rdh
/** * Returns the vertical scroll offset. Note that this is not necessarily the * same as the {@code scrollTop} attribute in the DOM. * * @return the logical vertical scroll offset */ public double getScrollTop() { return verticalScrollbar.getScrollPos();}
3.26
framework_Escalator_getMinCellWidth_rdh
/** * This is an internal method for calculating minimum width for Column * resize. * * @return minimum width for column */ double getMinCellWidth(int colIndex) { return columnConfiguration.getMinCellWidth(colIndex); }
3.26
framework_Escalator_getSpacerHeightsSumUntilPx_rdh
/** * Gets the amount of pixels occupied by spacers from the top until a * certain spot from the top of the body. * * @param px * pixels counted from the top * @return the pixels occupied by spacers up until {@code px} */ public double getSpacerHeightsSumUntilPx(double px) { return getSpacerHeightsSumBetweenPx...
3.26
framework_Escalator_scrollToSpacer_rdh
/** * Scrolls the body vertically so that the spacer at the given row index is * visible and there is at least {@literal padding} pixesl to the given * scroll destination. * * @since 7.5.0 * @param spacerIndex * the row index of the spacer to scroll to * @param destination * where the spacer should be ali...
3.26
framework_Escalator_snapDeltas_rdh
/** * Snap deltas of x and y to the major four axes (up, down, left, right) * with a threshold of a number of degrees from those axes. * * @param deltaX * the delta in the x axis * @param deltaY * the delta in the y axis * @param thresholdRatio * the threshold in ratio (0..1) between x and y for when to ...
3.26
framework_Escalator_setRowIndex_rdh
/** * Sets a new row index for this spacer. Also updates the bookeeping * at {@link SpacerContainer#rowIndexToSpacer}. */ @SuppressWarnings("boxing") public void setRowIndex(int rowIndex) { SpacerImpl spacer = rowIndexToSpacer.remove(this.rowIndex); assert this == spacer : "trying to move an unexpected spacer."; thi...
3.26
framework_Escalator_recalculateScrollbarsForVirtualViewport_rdh
/** * Recalculates the virtual viewport represented by the scrollbars, so * that the sizes of the scroll handles appear correct in the browser */ public void recalculateScrollbarsForVirtualViewport() {double v13 = body.calculateTotalRowHeight() + body.spacerContainer.getSpacerHeightsSum(); double scrollContentWidth ...
3.26
framework_Escalator_calculateRowWidth_rdh
/** * Calculate the width of a row, as the sum of columns' widths. * * @return the width of a row, in pixels */ public double calculateRowWidth() { return getCalculatedColumnsWidth(Range.between(0, getColumnCount())); }
3.26
framework_Escalator_reapplyRowWidths_rdh
/** * Applies the total length of the columns to each row element. * <p> * <em>Note:</em> In contrast to {@link #reapplyColumnWidths()}, this * method only modifies the width of the {@code <tr>} element, not the cells within. */ protected void reapplyRowWidths() { double rowWidth = columnConfiguration.calculateRow...
3.26
framework_Escalator_measureMinCellWidth_rdh
/** * Gets the minimum width needed to display the cell properly. * * @param colIndex * index of column to measure * @param withContent * <code>true</code> if content is taken into account, * <code>false</code> if not * @return cell width needed for displaying correctly */ double measureMinCellWidth(int ...
3.26
framework_Escalator_setEscalatorUpdater_rdh
/** * {@inheritDoc } * <p> * <em>Implementation detail:</em> This method does no DOM modifications * (i.e. is very cheap to call) if there is no data for rows or columns * when this method is called. * * @see #hasColumnAndRowData() */ @Override public void setEscalatorUpdater(final EscalatorUpdater escalatorUpd...
3.26
framework_Escalator_moveAndUpdateEscalatorRows_rdh
/** * Move escalator rows around, and make sure everything gets * appropriately repositioned and repainted. * * @param visualSourceRange * the range of rows to move to a new place * @param visualTargetIndex * the visual index where the rows will be placed to * @param logicalTargetIndex * the logical inde...
3.26
framework_Escalator_applyHeightByRows_rdh
/** * Reapplies the row-based height of the Grid, if Grid currently should * define its height that way. */ private void applyHeightByRows() { if ((heightMode != HeightMode.ROW) && (heightMode != HeightMode.UNDEFINED)) { return; } double headerHeight = header.getHeightOfSection(); double footerHeight = footer.getH...
3.26
framework_Escalator_removeColumns_rdh
/** * {@inheritDoc } * <p> * <em>Implementation detail:</em> This method does no DOM modifications * (i.e. is very cheap to call) if there are no rows in the DOM when * this method is called. * * @see #hasSomethingInDom() */ @Override public void removeColumns(final int index, final int numberOfColumns) { // Va...
3.26
framework_Escalator_getFooter_rdh
/** * Returns the row container for the footer in this Escalator. * * @return the footer. Never <code>null</code> */ public RowContainer getFooter() { return footer; }
3.26
framework_Escalator_scrollToRow_rdh
/** * Scrolls the body vertically so that the row at the given index is visible * and there is at least {@literal padding} pixels to the given scroll * destination. * * @param rowIndex * the index of the logical row to scroll to * @param destination * where the row should be aligned visually after scrolling...
3.26
framework_Escalator_isSpacer_rdh
/** * Checks if a given element is a spacer element */ public boolean isSpacer(Element row) { /* If this needs optimization, we could do a more heuristic check based on stylenames and stuff, instead of iterating through the map. */ for (SpacerImpl v369 : rowIndexToSpacer.values()) { if (v369.getRootElement().equal...
3.26
framework_Escalator_calculateTotalRowHeight_rdh
/** * Returns the height of all rows in the row container. */ protected double calculateTotalRowHeight() { return getDefaultRowHeight() * m2(); } /** * {@inheritDoc }
3.26
framework_Escalator_getScrollWidth_rdh
/** * Returns the scroll width for the escalator. Note that this is not * necessary the same as {@code Element.scrollWidth} in the DOM. * * @since 7.5.0 * @return the scroll width in pixels */ public double getScrollWidth() { return horizontalScrollbar.getScrollSize(); }
3.26
framework_Escalator_getSpacersAfterPx_rdh
/** * Get all spacers from one pixel point onwards. * <p> * * In this method, the {@link SpacerInclusionStrategy} has the following * meaning when a spacer lies in the middle of either pixel argument: * <dl> * <dt>{@link SpacerInclusionStrategy#COMPLETE COMPLETE} * <dd>include the spacer * <dt>{@link SpacerInc...
3.26
framework_Escalator_getHeightByRows_rdh
/** * Gets the amount of rows in Escalator's body that are shown, while * {@link #getHeightMode()} is {@link HeightMode#ROW}. * <p> * By default, it is 10. * * @return the amount of rows that are being shown in Escalator's body * @see #setHeightByRows(double) */ public double getHeightByRows() { return heightBy...
3.26
framework_Escalator_isScrollLocked_rdh
/** * Checks whether or not an direction is locked for scrolling. * * @param direction * the direction of the scroll of which to check the lock status * @return <code>true</code> if the direction is locked */public boolean isScrollLocked(ScrollbarBundle.Direction direction) { switch (direction) { case HORIZONTA...
3.26