public class SheetWidget
extends com.google.gwt.user.client.ui.Panel
| Constructor and Description |
|---|
SheetWidget(SheetHandler view,
boolean touchMode) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMergedRegion(MergedRegion region) |
void |
addPopupButton(PopupButtonWidget popupButton) |
void |
addSheetOverlay(String key,
SheetOverlay overlay) |
void |
addShiftedCellBorderStyles(List<String> styles) |
void |
cellValuesUpdated(ArrayList<CellData> updatedCellData) |
void |
clearAll(boolean removed)
Clears the sheet.
|
protected void |
clearBasicCellStyles() |
protected void |
clearCellCommentsAndInvalidFormulas() |
void |
clearCellRangeStyles()
Clears the highlight (background) on selected cells and their
corresponding headers.
|
protected void |
clearMergedCells() |
protected void |
clearPositionStyles() |
void |
clearSelectedCellsOnCut() |
void |
clearSelectedCellStyle()
Clears the light outline on the selected cell which is visible when the
selection is not coherent.
|
protected void |
clearShiftedBorderCellStyles() |
void |
commitComment(String text,
int col,
int row) |
void |
displayCustomCellEditor(com.google.gwt.user.client.ui.Widget customEditorWidget) |
void |
editCellComment(int col,
int row) |
void |
focusSheet() |
void |
focusSheet(boolean doAsDeferred) |
protected com.google.gwt.dom.client.Element |
getBottomLeftPane() |
protected com.google.gwt.dom.client.Element |
getBottomRightPane() |
int |
getBottomVisibleRowIndex()
Returns the first row index that is completely visible on the bottom.
|
CellData |
getCellData(int column,
int row) |
String |
getCellFormulaValue(int column,
int row) |
String |
getCellValue(int column,
int row) |
protected CopyPasteTextBox.CopyPasteHandler |
getCopyPasteHandler() |
protected Collection<com.google.gwt.user.client.ui.Widget> |
getCustomWidgetIterator() |
com.google.gwt.user.client.ui.TextBox |
getInlineEditor() |
int |
getLeftVisibleColumnIndex()
Returns the first column index that is completely visible on the left.
|
String |
getOriginalCellValue(int column,
int row) |
protected Cell |
getRealEventTargetCell(int clientX,
int clientY,
Cell cell) |
int |
getRightVisibleColumnIndex()
Returns the first column index that is completely visible on the right.
|
int[] |
getRowHeights() |
String |
getRules(com.google.gwt.dom.client.StyleElement stylesheet)
Clears the rules starting from the given index
|
int |
getSelectedCellColumn() |
String |
getSelectedCellKey() |
String |
getSelectedCellLatestValue() |
int |
getSelectedCellRow() |
int |
getSelectionBottomRow() |
int |
getSelectionLeftCol() |
int |
getSelectionRightCol() |
int |
getSelectionTopRow() |
int[] |
getSheetDisplayRange() |
SheetHandler |
getSheetHandler() |
protected SheetJsniUtil |
getSheetJsniUtil() |
int |
getSheetScrollLeft() |
int |
getSheetScrollTop() |
protected com.google.gwt.dom.client.Element |
getTopLeftPane() |
protected com.google.gwt.dom.client.Element |
getTopRightPane() |
int |
getTopVisibleRowIndex()
Returns the first row index that is completely visible on the top.
|
protected void |
handleInputElementValueChange(boolean update) |
boolean |
hasFrozenColumns() |
boolean |
hasFrozenRows() |
boolean |
isAreaCompletelyVisible(int col1,
int col2,
int row1,
int row2)
Is the given area currently visible completely.
|
boolean |
isCellCompletelyVisible(int col,
int row)
Is the given cell currently visible completely.
|
boolean |
isCellLocked(int column,
int row) |
boolean |
isCellRendered(int col,
int row)
Is the given cell currently rendered.
|
boolean |
isCellRenderedInBottomLeftPane(int col,
int row)
Is the cell currently rendered in bottom left pane.
|
boolean |
isCellRenderedInScrollPane(int col,
int row) |
boolean |
isCellRenderedInTopLeftPane(int col,
int row)
Is the cell currently rendered in top left pane.
|
boolean |
isCellRenderedInTopRightPane(int col,
int row)
Is the cell currently rendered in top right pane.
|
boolean |
isCoherentSelection() |
protected boolean |
isEditingCell() |
protected boolean |
isEventInCustomEditorCell(com.google.gwt.user.client.Event event) |
boolean |
isFrozenCellRendered(int col,
int row)
Is the cell currently rendered in any of the frozen panes.
|
protected boolean |
isMouseButtonDownAndSelecting() |
boolean |
isSelectedCellCompletelyVisible() |
boolean |
isSelectedCellCustomized() |
boolean |
isSelectedCellPergentage() |
boolean |
isSelectedCellRendered() |
boolean |
isSelectionAreaCompletelyVisible() |
boolean |
isSelectionRangeOutlineVisible() |
boolean |
isSheetElement(com.google.gwt.dom.client.Element cast) |
boolean |
isTouchMode() |
Iterator<com.google.gwt.user.client.ui.Widget> |
iterator() |
protected void |
onAttach() |
protected void |
onCellCommentFocus(CellComment cellComment) |
protected void |
onMouseMoveWhenSelectingCells(com.google.gwt.user.client.Event event) |
protected void |
onSheetMouseDown(com.google.gwt.user.client.Event event) |
protected void |
onSheetMouseMove(com.google.gwt.user.client.Event event) |
protected void |
onSheetMouseOverOrOut(com.google.gwt.user.client.Event event)
This is using a delayed execution because we don't want to try to do
stuff when it is unnecessary.
|
protected void |
onSheetScroll(com.google.gwt.user.client.Event event) |
void |
onUnload() |
void |
onWidgetResize() |
void |
refreshAlwaysVisibleCellCommentOverlays() |
void |
refreshCellStyles() |
void |
refreshCurrentCellCommentOverlay() |
void |
refreshPopupButtonOverlays() |
void |
relayoutSheet(boolean triggerRequest) |
boolean |
remove(com.google.gwt.user.client.ui.Widget child) |
void |
removeCustomCellEditor() |
void |
removeMergedRegion(MergedRegion region,
int ruleIndex) |
void |
removePopupButton(PopupButtonWidget popupButton) |
void |
removeSheetOverlay(String key) |
void |
removeShiftedCellBorderStyles() |
void |
removeStyles()
For internal use.
|
void |
replaceAsSelectedCells(int col1,
int col2,
int row1,
int row2)
Marks the given interval as selected (highlighted background), replaces
old selected cells.
|
void |
replaceHeadersAsSelected(int row1,
int row2,
int col1,
int col2)
Replaces the currently marked selected headers (highlighted) with the
given intervals.
|
protected void |
requestCells() |
void |
resetFromModel(int scrollLeft,
int scrollTop)
Set the model that stores the contents of the spreadsheet.
|
void |
scrollAreaIntoView(int col1,
int col2,
int row1,
int row2)
Scrolls the sheet to show the given area, or as much of it as fits into
the view.
|
void |
scrollCellIntoView(int col,
int row)
Scrolls the sheet to show the given cell, then triggers escalator for
updating cells if necessary.
|
void |
scrollSelectedCellIntoView() |
void |
scrollSelectionAreaIntoView() |
void |
setCellComments(HashMap<String,String> newCellCommentsMap,
HashMap<String,String> newCellCommentAuthorsMap) |
void |
setCellCommentVisible(boolean visible,
String key) |
void |
setCellLinks(HashMap<String,String> cellLinksMap) |
void |
setCoherentSelection(boolean coherentSelection) |
void |
setColGroupingData(List<GroupingData> data) |
void |
setColGroupingInversed(boolean inversed) |
void |
setColGroupingMax(int max) |
void |
setDisplayGridlines(boolean displayGridlines) |
void |
setDisplayRowColHeadings(boolean displayRowColHeadings) |
void |
setFocused(boolean focused) |
void |
setHorizontalSplitPosition(int horizontalSplitPosition) |
void |
setInvalidFormulaCells(Set<String> newInvalidFormulaCells) |
void |
setInvalidFormulaMessage(String invalidFormulaMessage) |
void |
setRowGroupingData(List<GroupingData> data) |
void |
setRowGroupingInversed(boolean inversed) |
void |
setRowGroupingMax(int max) |
void |
setScrollPosition(int scrollLeft,
int scrollTop) |
void |
setSelectedCell(int col,
int row) |
void |
setSelectionRangeOutlineVisible(boolean visible) |
void |
setTouchMode(boolean touchMode) |
void |
setVerticalSplitPosition(int verticalSplitPosition) |
void |
showCustomWidgets(HashMap<String,com.google.gwt.user.client.ui.Widget> newWidgetMap) |
void |
startEditingCell(boolean focus,
boolean recalculate,
String value) |
void |
stopEditingCell(boolean focusSheet) |
protected void |
stoppedSelectingCellsWithDrag(com.google.gwt.user.client.Event event) |
void |
swapCellSelection(int column,
int row)
Swaps the selected cell to the new one, which is the selected cell after
this call.
|
void |
swapSelectedCellInsideSelection(int col,
int row)
Swaps the selected cell to the new one, which is the selected cell after
this call.
|
static String |
toCssKey(int col,
int row)
Generates css key for the cell.
|
static String |
toKey(int col,
int row)
Generates classname key for the cell.
|
void |
updateBottomLeftCellValues(List<CellData> cellData2) |
void |
updateBottomRightCellValues(List<CellData> cellData2) |
void |
updateInputValue(String value) |
void |
updateMergedRegionSize(MergedRegion region) |
void |
updateOverlayInfo(String key,
OverlayInfo overlayInfo) |
void |
updatePopupButtonPosition(PopupButtonWidget popupButton,
int oldRow,
int oldCol,
int newRow,
int newCol)
PopupButtons should not change position (cell), but the popupButton's col
and row values come after the popupButton has actually been added.
|
void |
updateSelectedCellStyles(int col1,
int col2,
int row1,
int row2,
boolean replace) |
void |
updateSelectedCellValue(String value) |
void |
updateSelectionOutline(int col1,
int col2,
int row1,
int row2) |
void |
updateTopLeftCellValues(List<CellData> cellData2) |
void |
updateTopRightCellValues(List<CellData> cellData2) |
add, add, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic SheetWidget(SheetHandler view, boolean touchMode)
protected CopyPasteTextBox.CopyPasteHandler getCopyPasteHandler()
protected void onAttach()
onAttach in class com.google.gwt.user.client.ui.Widgetpublic SheetHandler getSheetHandler()
protected SheetJsniUtil getSheetJsniUtil()
public void onUnload()
onUnload in class com.google.gwt.user.client.ui.Widgetprotected void requestCells()
public void resetFromModel(int scrollLeft,
int scrollTop)
public void relayoutSheet(boolean triggerRequest)
public void onWidgetResize()
public void removeStyles()
protected void onSheetScroll(com.google.gwt.user.client.Event event)
protected void onSheetMouseOverOrOut(com.google.gwt.user.client.Event event)
event - protected void onSheetMouseMove(com.google.gwt.user.client.Event event)
protected boolean isEventInCustomEditorCell(com.google.gwt.user.client.Event event)
protected void onSheetMouseDown(com.google.gwt.user.client.Event event)
event - The original event (that can be onClick or onTouchStart)protected void onMouseMoveWhenSelectingCells(com.google.gwt.user.client.Event event)
protected void stoppedSelectingCellsWithDrag(com.google.gwt.user.client.Event event)
protected boolean isEditingCell()
protected boolean isMouseButtonDownAndSelecting()
public CellData getCellData(int column, int row)
public String getCellValue(int column, int row)
public boolean isCellLocked(int column,
int row)
public String getCellFormulaValue(int column, int row)
public String getOriginalCellValue(int column, int row)
public String getRules(com.google.gwt.dom.client.StyleElement stylesheet)
public com.google.gwt.user.client.ui.TextBox getInlineEditor()
public boolean isSelectedCellCustomized()
public void showCustomWidgets(HashMap<String,com.google.gwt.user.client.ui.Widget> newWidgetMap)
public void addSheetOverlay(String key, SheetOverlay overlay)
public void updateOverlayInfo(String key, OverlayInfo overlayInfo)
public void removeSheetOverlay(String key)
public void addMergedRegion(MergedRegion region)
public void updateMergedRegionSize(MergedRegion region)
public void removeMergedRegion(MergedRegion region, int ruleIndex)
public void setCellComments(HashMap<String,String> newCellCommentsMap, HashMap<String,String> newCellCommentAuthorsMap)
public void setCellCommentVisible(boolean visible,
String key)
public void refreshAlwaysVisibleCellCommentOverlays()
public void refreshCurrentCellCommentOverlay()
public void refreshPopupButtonOverlays()
protected void onCellCommentFocus(CellComment cellComment)
public int[] getRowHeights()
protected void handleInputElementValueChange(boolean update)
public static final String toKey(int col, int row)
col - column index, 1 basedrow - row index, 1 basedpublic static final String toCssKey(int col, int row)
col - column index, 1 basedrow - row index, 1 basedpublic void clearAll(boolean removed)
removed - if the widget is completely removed from DOM after thispublic String getSelectedCellKey()
public int getSelectedCellColumn()
public int getSelectedCellRow()
public String getSelectedCellLatestValue()
public void setSelectedCell(int col,
int row)
public int getSelectionLeftCol()
public int getSelectionRightCol()
public int getSelectionTopRow()
public int getSelectionBottomRow()
public boolean isCoherentSelection()
public void setCoherentSelection(boolean coherentSelection)
public void setSelectionRangeOutlineVisible(boolean visible)
public boolean isSelectionRangeOutlineVisible()
public void updateSelectionOutline(int col1,
int col2,
int row1,
int row2)
public void updateSelectedCellStyles(int col1,
int col2,
int row1,
int row2,
boolean replace)
public void clearSelectedCellStyle()
public void clearCellRangeStyles()
protected void clearPositionStyles()
protected void clearBasicCellStyles()
protected void clearShiftedBorderCellStyles()
protected void clearMergedCells()
protected void clearCellCommentsAndInvalidFormulas()
public void swapCellSelection(int column,
int row)
column - index, 1-basedrow - index, 1-basedpublic void swapSelectedCellInsideSelection(int col,
int row)
swapCellSelection(int, int) because the selected cell should be
inside the old selection, instead of adding a new cell into the
selection. No need to modify highlighted headers.col - column index, 1-basedrow - row index, 1-basedpublic void replaceAsSelectedCells(int col1,
int col2,
int row1,
int row2)
col1 - starting column index, 1-basedcol2 - ending column index, 1-basedrow1 - starting row index, 1-basedrow2 - ending row index, 1-basedpublic void replaceHeadersAsSelected(int row1,
int row2,
int col1,
int col2)
row1 - starting row index, 1-basedrow2 - ending row index, 1-basedcol1 - starting column index, 1-basedcol2 - ending column index, 1-basedpublic int[] getSheetDisplayRange()
public boolean hasFrozenColumns()
public boolean hasFrozenRows()
public int getLeftVisibleColumnIndex()
public int getRightVisibleColumnIndex()
public int getTopVisibleRowIndex()
public int getBottomVisibleRowIndex()
public void displayCustomCellEditor(com.google.gwt.user.client.ui.Widget customEditorWidget)
public void removeCustomCellEditor()
public void startEditingCell(boolean focus,
boolean recalculate,
String value)
public void updateSelectedCellValue(String value)
public void updateInputValue(String value)
public void stopEditingCell(boolean focusSheet)
public void focusSheet()
public void focusSheet(boolean doAsDeferred)
public boolean isSelectedCellRendered()
public boolean isSelectedCellCompletelyVisible()
public boolean isSelectionAreaCompletelyVisible()
public boolean isCellRenderedInScrollPane(int col,
int row)
public boolean isFrozenCellRendered(int col,
int row)
col - column index, 1-basedrow - row index, 1-basedtrue if rendered within a frozen pane, false
otherwisepublic boolean isCellRenderedInTopLeftPane(int col,
int row)
col - column index, 1-basedrow - row index, 1-basedtrue if rendered within top left pane, false
otherwisepublic boolean isCellRenderedInTopRightPane(int col,
int row)
col - column index, 1-basedrow - row index, 1-basedtrue if rendered within top right pane, false
otherwisepublic boolean isCellRenderedInBottomLeftPane(int col,
int row)
col - column index, 1-basedrow - row index, 1-basedtrue if rendered within bottom left pane, false
otherwisepublic boolean isCellRendered(int col,
int row)
col - column index, 1-basedrow - row index, 1-basedtrue if rendered, false otherwisepublic boolean isCellCompletelyVisible(int col,
int row)
col - column index, 1-basedrow - row index, 1-basedtrue if completely visible, false otherwisepublic boolean isAreaCompletelyVisible(int col1,
int col2,
int row1,
int row2)
col1 - starting column index, 1-basedcol2 - ending column index, 1-basedrow1 - starting row index, 1-basedrow2 - ending row index, 1-basedtrue if completely visible, false otherwisepublic void scrollSelectedCellIntoView()
public void scrollCellIntoView(int col,
int row)
isCellRenderedInScrollPane(int, int) in
itself, so no need to do the check before calling this. Nothing is done
if the cell is already visible.
Scrolls one cell extra to all directions to cut the scrolls to half when
using keyboard navigation.col - column index, 1-basedrow - row index, 1-basedpublic void scrollSelectionAreaIntoView()
public void scrollAreaIntoView(int col1,
int col2,
int row1,
int row2)
col1 - starting column index, 1-basedcol2 - ending column index, 1-basedrow1 - starting row index, 1-basedrow2 - ending row index, 1-basedpublic void removeShiftedCellBorderStyles()
public int getSheetScrollLeft()
public int getSheetScrollTop()
public void setScrollPosition(int scrollLeft,
int scrollTop)
public void addPopupButton(PopupButtonWidget popupButton)
public void removePopupButton(PopupButtonWidget popupButton)
public void updatePopupButtonPosition(PopupButtonWidget popupButton, int oldRow, int oldCol, int newRow, int newCol)
public Iterator<com.google.gwt.user.client.ui.Widget> iterator()
protected Collection<com.google.gwt.user.client.ui.Widget> getCustomWidgetIterator()
public boolean remove(com.google.gwt.user.client.ui.Widget child)
remove in interface com.google.gwt.user.client.ui.HasWidgetsremove in class com.google.gwt.user.client.ui.Panelpublic void setDisplayGridlines(boolean displayGridlines)
public void setDisplayRowColHeadings(boolean displayRowColHeadings)
public void setVerticalSplitPosition(int verticalSplitPosition)
public void setHorizontalSplitPosition(int horizontalSplitPosition)
protected com.google.gwt.dom.client.Element getBottomRightPane()
protected com.google.gwt.dom.client.Element getBottomLeftPane()
protected com.google.gwt.dom.client.Element getTopRightPane()
protected com.google.gwt.dom.client.Element getTopLeftPane()
public boolean isSheetElement(com.google.gwt.dom.client.Element cast)
public void clearSelectedCellsOnCut()
public void refreshCellStyles()
public boolean isTouchMode()
public void setTouchMode(boolean touchMode)
public void editCellComment(int col,
int row)
public void commitComment(String text, int col, int row)
public boolean isSelectedCellPergentage()
public void setFocused(boolean focused)
public void setColGroupingData(List<GroupingData> data)
public void setRowGroupingData(List<GroupingData> data)
public void setColGroupingMax(int max)
public void setRowGroupingMax(int max)
public void setColGroupingInversed(boolean inversed)
public void setRowGroupingInversed(boolean inversed)
public void setInvalidFormulaMessage(String invalidFormulaMessage)
Copyright © 2013–2026 Vaadin Ltd. All rights reserved.