Class SJTable
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.grid.Grid<Integer>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<com.vaadin.flow.component.grid.Grid<Integer>>, com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.grid.Grid<Integer>>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.data.event.SortEvent.SortNotifier<com.vaadin.flow.component.grid.Grid<Integer>, com.vaadin.flow.component.grid.GridSortOrder<Integer>>, com.vaadin.flow.data.provider.HasDataGenerators<Integer>, com.vaadin.flow.data.provider.HasDataView<Integer, Void, com.vaadin.flow.component.grid.dataview.GridDataView<Integer>>, com.vaadin.flow.data.provider.HasLazyDataView<Integer, Void, com.vaadin.flow.component.grid.dataview.GridLazyDataView<Integer>>, com.vaadin.flow.data.provider.HasListDataView<Integer, com.vaadin.flow.component.grid.dataview.GridListDataView<Integer>>, ComponentMixin, ContainerMixin, JComponentMixin, Serializable, EventListener, ListSelectionListener, TableColumnModelListener, TableModelListener
JTable (SD_sjtable). Extends Vaadin
Grid<Integer> — row indices are the Grid's items,
which keeps the installed TableModel as the single source of
truth (R_swing_is_truth) and lets setValueAt updates reflect on next render
without snapshot rebuilds.
Vaadin-first rendering (R_vaadin_first)
Surrogate-layer code uses Vaadin'sRenderer
surface for column rendering — install via setRenderer(int, Renderer).
The JDK TableCellRenderer surface (return type
java.awt.Component clashes with our hierarchy per D_event_port_policy) lives
only on the emulator layer (:emulators.JTable); the emulator
translates its ported vaadinx.swing.table.TableCellRenderer
registry into Vaadin renderers and installs via setRenderer(int, Renderer).
Pure-surrogate users without setRenderer(int, Renderer) get a default
value.toString() Span renderer for every column —
matches the SJComboBox precedent (default setItemLabelGenerator
with String.valueOf).
Row-index identity
Each Vaadin row carries the boxedInteger index into the model.
Per-cell renderer reads model.getValueAt(row, modelCol) live, so
fireTableRowsUpdated just calls
dataProvider.refreshItem(row) — no array-snapshot resync. The
ListSelectionModel is index-based already, so the bridge to
Vaadin Grid's selection (which carries the same Integer keys) is direct.
Listener-list architecture
SJTable IS-ATableModelListener / TableColumnModelListener /
ListSelectionListener — JDK JTable's pattern. The surrogate
subscribes itself to the installed model, column model, and selection
model on install/swap; user code subscribes directly to those models
(no surrogate-level convenience listener registration). The internal
subscriptions handle (a) column rebuild on structure change, (b) Grid
data refresh on row change, (c) Grid selection push on selection-model
change. Vaadin → us flows via a addSelectionListener subscription
wrapped in SHelper.callSwing(Runnable) (R_callswing_envelope) and writes through to
ListSelectionModel, closing the loop.
R_vaadin_first drop-and-WARN surface
Cell-editor surface (R_match_swing_errors sub-bucket (b)),TableRowSorter / RowFilter (deferred),
dragEnabled / dropMode (cross-cutting DnD),
column-cell selection (Vaadin Grid is row-only),
intercellSpacing / gridColor / showHorizontalLines
(Vaadin theme owns chrome), rowHeight on push (Vaadin auto-
heights), printing (permanent sub-bucket (b)).- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.grid.Grid
com.vaadin.flow.component.grid.Grid.AbstractGridExtension<T>, com.vaadin.flow.component.grid.Grid.Column<T>, com.vaadin.flow.component.grid.Grid.DataCommunicatorBuilder<T,U>, com.vaadin.flow.component.grid.Grid.MultiSortPriority, com.vaadin.flow.component.grid.Grid.NestedNullBehavior, com.vaadin.flow.component.grid.Grid.SelectionMode, com.vaadin.flow.component.grid.Grid.SpringData, com.vaadin.flow.component.grid.Grid.UpdateQueue Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C>Nested classes/interfaces inherited from interface JComponentMixin
JComponentMixin.ActionStandin -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from interface JComponentMixin
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW -
Constructor Summary
ConstructorsConstructorDescriptionSJTable()SJTable(int numRows, int numCols) SJTable(TableModel dm) SJTable(TableModel dm, TableColumnModel cm) SJTable(TableModel dm, TableColumnModel cm, ListSelectionModel sm) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(TableColumn aColumn) voidOverrides the inheritedComponentMixinwire — Grid dispatches item clicks carrying the row item + clicked column, not generic component clicks.voidaddRowSelectionInterval(int index0, int index1) voidvoidintcolumnAtPoint(Point point) View-column index of the cell currently being click-dispatched, or-1(outside a dispatch, or a row-only click that carries no column).voidvoidvoidvoidintconvertColumnIndexToModel(int viewColumnIndex) intconvertColumnIndexToView(int modelColumnIndex) intconvertRowIndexToModel(int viewRowIndex) Routes through the installedRowSorterwhen present; identity otherwise.intconvertRowIndexToView(int modelRowIndex) Routes through the installedRowSorterwhen present; identity otherwise.protected TableColumnModelvoidRebuild theTableColumnModelfrom the currentTableModel's structure.protected TableModelprotected ListSelectionModelvoideditCellAt(int row, int column) booleaneditCellAt(int row, int column, EventObject e) booleanbooleanintgetCellRect(int row, int column, boolean includeSpacing) booleanClass<?> getColumnClass(int column) intgetColumnName(int column) booleanbooleanintintcom.vaadin.flow.component.ComponentbooleanintAccessor for the current JDK selection mode (one ofListSelectionModel.SINGLE_SELECTION / SINGLE_INTERVAL_SELECTION / MULTIPLE_INTERVAL_SELECTION).JDKgetSelectionModel(): ListSelectionModelcan't coexist with Vaadin Grid's same-namedgetSelectionModel(): GridSelectionModel<T>(different return types, can't override).getModel()intintintgetRowHeight(int row) intbooleanRowSorter<? extends TableModel> Returns the currently installed JDKRowSorter, ornullwhen no sort is active.intintint[]booleanbooleanbooleanDeliberate no-op — L&F key.getValueAt(int row, int column) booleanisCellEditable(int row, int column) booleanbooleanWhether anEditorCloseListenerrunning now was fired because the Grid's data changed — Vaadin closes an open editor on every data change,refreshAll()included — rather than because the user left the cell.booleanisRowSelected(int row) voidmoveColumn(int columnIndex, int newIndex) protected voidvoidremoveColumn(TableColumn aColumn) voidvoidremoveRowSelectionInterval(int index0, int index1) introwAtPoint(Point point) Row index of the cell currently being click-dispatched (stashed byaddMouseListener(SMouseListener)'s item-click wire), or-1outside a dispatch.voidvoidsetAutoCreateColumnsFromModel(boolean autoCreate) voidsetAutoCreateRowSorter(boolean autoCreateRowSorter) voidsetAutoResizeMode(int mode) voidsetCellSelectionEnabled(boolean cellSelectionEnabled) voidsetColumnModel(TableColumnModel newModel) voidsetColumnSelectionAllowed(boolean columnSelectionAllowed) voidsetDragEnabled(boolean dragEnabled) voidsetFillsViewportHeight(boolean fillsViewportHeight) voidsetGridColor(Color gridColor) voidsetIntercellSpacing(Dimension intercellSpacing) voidsetModel(TableModel newModel) voidvoidsetRefreshProtectedRow(Integer modelRow) Protect (or, withnull, un-protect) a model row fromrefreshItemon UPDATE events.voidsetRenderer(int viewColumnIndex, com.vaadin.flow.data.renderer.Renderer<Integer> renderer) Vaadin-first cell renderer install per R_vaadin_first.voidsetRowHeight(int rowHeight) voidsetRowHeight(int row, int rowHeight) voidsetRowMargin(int rowMargin) voidsetRowSelectionAllowed(boolean rowSelectionAllowed) voidsetRowSelectionInterval(int index0, int index1) voidsetRowSorter(RowSorter<? extends TableModel> newRowSorter) Install a JDKRowSorteron this table.voidsetSelectionBackground(Color selectionBackground) voidsetSelectionForeground(Color selectionForeground) voidsetSelectionMode(int selectionMode) JDK selection-mode setter.voidsetSelectionModel(ListSelectionModel newModel) voidsetShowGrid(boolean showGrid) voidsetShowHorizontalLines(boolean showHorizontalLines) voidsetShowVerticalLines(boolean showVerticalLines) voidsetValueAt(Object aValue, int row, int column) voidApplies a model change to the sorter, the selection and the Grid, in that order.voidMethods inherited from class com.vaadin.flow.component.grid.Grid
addCellFocusListener, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumn, addColumnReorderListener, addColumnResizeListener, addColumns, addComponentColumn, addContextMenu, addDataGenerator, addDragEndListener, addDragStartListener, addDropListener, addFirstHeaderRow, addItemClickListener, addItemDoubleClickListener, addSelectionListener, addSortListener, addThemeVariants, addValueProvider, appendFooterRow, appendHeaderRow, asMultiSelect, asSingleSelect, compareMaybeComparables, configureBeanType, createColumn, createColumnId, createDataCommunicator, createDefaultArrayUpdater, createEditor, createSortingComparator, deselect, deselectAll, getAriaLabel, getArrayUpdater, getBeanType, getColumnByInternalId, getColumnByKey, getColumnLayers, getColumnRendering, getColumns, getCompositeDataGenerator, getDataCommunicator, getDataProvider, getDefaultColumnFactory, getDefaultHeaderRow, getDragFilter, getDropFilter, getDropMode, getEditor, getEmptyStateComponent, getEmptyStateText, getFooterRows, getGenericDataView, getHeaderRows, getI18n, getLazyDataView, getListDataView, getNestedNullBehavior, getPageSize, getPartNameGenerator, getPropertySet, getSelectedItems, getSelectionMode, getSelectionModel, getSelectionPreservationMode, getSortOrder, getTooltipPosition, getUniqueKeyProperty, getUniqueKeyProvider, initConnector, insertColumnLayer, isAllRowsVisible, isColumnReorderingAllowed, isDetailsVisible, isDetailsVisibleOnClick, isMultiSort, isRowsDraggable, isTooltipMarkdownEnabled, onAttach, onDetach, onEnabledStateChanged, prependFooterRow, prependHeaderRow, recalculateColumnWidths, refreshViewport, removeAllColumns, removeAllFooterRows, removeAllHeaderRows, removeColumn, removeColumnByKey, removeColumnLayer, removeColumns, removeFooterRow, removeHeaderRow, removeThemeVariants, scheduleScrollExecution, scrollToColumn, scrollToColumn, scrollToEnd, scrollToIndex, scrollToItem, scrollToStart, select, setAllRowsVisible, setAriaLabel, setColumnKey, setColumnOrder, setColumnOrder, setColumnRendering, setColumnReorderingAllowed, setColumns, setDataProvider, setDefaultMultiSortPriority, setDetailsVisible, setDetailsVisibleOnClick, setDragDataGenerator, setDragFilter, setDropFilter, setDropMode, setEmptyStateComponent, setEmptyStateText, setI18n, setItemDetailsRenderer, setItems, setItems, setItems, setItems, setItemSelectableProvider, setItemsPageable, setItemsPageable, setMultiSort, setMultiSort, setMultiSort, setMultiSort, setNestedNullBehavior, setPageSize, setPartNameGenerator, setRowsDraggable, setSelectionDragDetails, setSelectionMode, setSelectionModel, setSelectionPreservationMode, setSortableColumns, setTooltipGenerator, setTooltipMarkdownEnabled, setTooltipPosition, setUniqueKeyProperty, setUniqueKeyProvider, sort, updateSelectionModeOnClientMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface ComponentMixin
_installSwingClass, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, dispatchEvent, doLayout, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getComponentListeners, getCursor, getFocusListeners, getFont, getForeground, getGraphics, getHierarchyBoundsListeners, getHierarchyListeners, getKeyListeners, getLocation, getMaximumSize, getMinimumSize, getMouseListeners, getName, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolTipText, getX, getY, grabFocus, hasFocus, invalidate, isDisplayable, isFocusable, isFocusOwner, isShowing, paint, paintAll, print, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, revalidate, setBackground, setBounds, setBounds, setCursor, setFocusable, setFont, setForeground, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validateMethods inherited from interface ContainerMixin
addContainerListener, getContainerListeners, getLayout, paintComponents, printComponents, removeContainerListener, setLayoutMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabledMethods inherited from interface com.vaadin.flow.data.provider.HasLazyDataView
setItems, setItemsMethods inherited from interface com.vaadin.flow.data.provider.HasListDataView
setItems, setItemsMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface JComponentMixin
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, isDoubleBuffered, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, requestDefaultFocus, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateUI
-
Field Details
-
AUTO_RESIZE_OFF
public static final int AUTO_RESIZE_OFF- See Also:
-
AUTO_RESIZE_NEXT_COLUMN
public static final int AUTO_RESIZE_NEXT_COLUMN- See Also:
-
AUTO_RESIZE_SUBSEQUENT_COLUMNS
public static final int AUTO_RESIZE_SUBSEQUENT_COLUMNS- See Also:
-
AUTO_RESIZE_LAST_COLUMN
public static final int AUTO_RESIZE_LAST_COLUMN- See Also:
-
AUTO_RESIZE_ALL_COLUMNS
public static final int AUTO_RESIZE_ALL_COLUMNS- See Also:
-
-
Constructor Details
-
SJTable
public SJTable() -
SJTable
-
SJTable
-
SJTable
-
SJTable
public SJTable(int numRows, int numCols) -
SJTable
-
SJTable
-
-
Method Details
-
createDefaultDataModel
-
createDefaultColumnModel
-
createDefaultSelectionModel
-
getModel
-
setModel
-
getColumnModel
-
setColumnModel
-
getListSelectionModel
JDKgetSelectionModel(): ListSelectionModelcan't coexist with Vaadin Grid's same-namedgetSelectionModel(): GridSelectionModel<T>(different return types, can't override). Per R_vaadin_first the Vaadin shape wins at the surrogate layer; pure-surrogate code reads selection viasetSelectionMode(int)/setRowSelectionInterval(int, int)/getSelectedRow()instead. The emulator layer (:emulators.JTable) keeps the JDK-shaped getter for stage-2 import-swap compatibility — and reaches the JDK model throughgetListSelectionModel()below. -
getJdkSelectionMode
public int getJdkSelectionMode()Accessor for the current JDK selection mode (one ofListSelectionModel.SINGLE_SELECTION / SINGLE_INTERVAL_SELECTION / MULTIPLE_INTERVAL_SELECTION). Distinct name from any Vaadin Grid getter (Vaadin Grid 25 has no publicgetSelectionMode(), but the differing name future-proofs). Used by the emulator layer to read the previous mode for PCE delivery onsetSelectionMode(int)swaps. -
setSelectionModel
-
getRowCount
public int getRowCount() -
getColumnCount
public int getColumnCount() -
getColumnName
-
getColumnClass
-
getValueAt
-
setValueAt
-
isCellEditable
public boolean isCellEditable(int row, int column) -
convertColumnIndexToView
public int convertColumnIndexToView(int modelColumnIndex) -
convertColumnIndexToModel
public int convertColumnIndexToModel(int viewColumnIndex) -
convertRowIndexToView
public int convertRowIndexToView(int modelRowIndex) Routes through the installedRowSorterwhen present; identity otherwise. -
convertRowIndexToModel
public int convertRowIndexToModel(int viewRowIndex) Routes through the installedRowSorterwhen present; identity otherwise. -
setRenderer
public void setRenderer(int viewColumnIndex, com.vaadin.flow.data.renderer.Renderer<Integer> renderer) Vaadin-first cell renderer install per R_vaadin_first. Replaces the column atviewColumnIndexwith one driven by the supplied VaadinRenderer<Integer>. The header text and key are preserved across the swap. Migrated code at the surrogate stage uses this rather than the JDKTableCellRenderersurface (which lives only on the emulator layer per D_event_port_policy + R_vaadin_first).Throws
IndexOutOfBoundsExceptionwhenviewColumnIndexis out of range — matches Vaadin's column accessors.Swaps the renderer in place via
Grid.Column.setRenderer(Renderer): theGrid.Columninstance persists, so header / key / sortability / sort property / column order — and anysetEditorComponent— are all preserved automatically, and the swap is churn-free (safe to call repeatedly, e.g. the emulator re-installs renderers on everysetDefaultRenderer/ per-column renderer change). -
createDefaultColumnsFromModel
public void createDefaultColumnsFromModel()Rebuild theTableColumnModelfrom the currentTableModel's structure. Called whenautoCreateColumnsFromModelis true and the model fires a HEADER_ROWTableModelEvent. -
tableChanged
Applies a model change to the sorter, the selection and the Grid, in that order.The installed
RowSorterhears the change first, because nothing else tells it:TableRowSorterdoes not listen to its model, it is the table's job to forward every event. Until told, it keeps answeringgetViewRowCount()and the index conversions from the rows it last saw, andcount(Query)andfetch(Query)read through it.The selection needs no re-mapping across the change: it holds model rows (D_jtable_cell_editing), so a re-sort leaves it valid, and inserts and deletes shift it here in model coordinates.
Hops onto the owner's UI thread, since a worker filling the model is the ordinary Swing pattern (SD_background_model_hop).
- Specified by:
tableChangedin interfaceTableModelListener
-
setRefreshProtectedRow
Protect (or, withnull, un-protect) a model row fromrefreshItemon UPDATE events. The emulator's cell-editing lifecycle drives this so an externalsetValueAtcan't re-render the row hosting an open editor (D_jtable_cell_editing Task 2). Machinery, not editing API. -
isEditorClosingForDataChange
public boolean isEditorClosingForDataChange()Whether anEditorCloseListenerrunning now was fired because the Grid's data changed — Vaadin closes an open editor on every data change,refreshAll()included — rather than because the user left the cell. Machinery for the emulator, whose JDK contract keeps an edit open across a model change; not editing API. -
onDataProviderChange
protected void onDataProviderChange()- Overrides:
onDataProviderChangein classcom.vaadin.flow.component.grid.Grid<Integer>
-
columnAdded
- Specified by:
columnAddedin interfaceTableColumnModelListener
-
columnRemoved
- Specified by:
columnRemovedin interfaceTableColumnModelListener
-
columnMoved
- Specified by:
columnMovedin interfaceTableColumnModelListener
-
columnMarginChanged
- Specified by:
columnMarginChangedin interfaceTableColumnModelListener
-
columnSelectionChanged
- Specified by:
columnSelectionChangedin interfaceTableColumnModelListener
-
valueChanged
- Specified by:
valueChangedin interfaceListSelectionListener
-
setRowSelectionInterval
public void setRowSelectionInterval(int index0, int index1) -
addRowSelectionInterval
public void addRowSelectionInterval(int index0, int index1) -
removeRowSelectionInterval
public void removeRowSelectionInterval(int index0, int index1) -
clearSelection
public void clearSelection() -
getSelectedRow
public int getSelectedRow() -
getSelectedRows
public int[] getSelectedRows() -
getSelectedRowCount
public int getSelectedRowCount() -
isRowSelected
public boolean isRowSelected(int row) -
selectAll
public void selectAll() -
setSelectionMode
public void setSelectionMode(int selectionMode) JDK selection-mode setter. Validates per JDK contract (throws IAE on unrecognised mode), updates the underlyingListSelectionModel, and maps to Vaadin Grid'sGrid.SelectionMode: SINGLE → SINGLE; the two interval modes both map to MULTI since Vaadin Grid has no single-interval analog. TheListSelectionModelstill enforces the JDK contract; the divergence is browser-side ctrl-click extending past the interval — the model rejects the second selection so the UI reverts. -
getRowSelectionAllowed
public boolean getRowSelectionAllowed() -
setRowSelectionAllowed
public void setRowSelectionAllowed(boolean rowSelectionAllowed) -
getColumnSelectionAllowed
public boolean getColumnSelectionAllowed() -
setColumnSelectionAllowed
public void setColumnSelectionAllowed(boolean columnSelectionAllowed) -
getCellSelectionEnabled
public boolean getCellSelectionEnabled() -
setCellSelectionEnabled
public void setCellSelectionEnabled(boolean cellSelectionEnabled) -
addColumn
-
removeColumn
-
moveColumn
public void moveColumn(int columnIndex, int newIndex) -
getColumn
-
getAutoCreateColumnsFromModel
public boolean getAutoCreateColumnsFromModel() -
setAutoCreateColumnsFromModel
public void setAutoCreateColumnsFromModel(boolean autoCreate) -
getAutoCreateRowSorter
public boolean getAutoCreateRowSorter() -
setAutoCreateRowSorter
public void setAutoCreateRowSorter(boolean autoCreateRowSorter) -
getRowSorter
Returns the currently installed JDKRowSorter, ornullwhen no sort is active. Migrators read this to inspectgetSortKeys()or to calltoggleSortOrder(column)programmatically. -
setRowSorter
Install a JDKRowSorteron this table.nullclears sort entirely (subsequent Vaadin Grid header clicks fall back to model order). Detaches ourRowSorterListenerfrom the old sorter and attaches a fresh one to the new — programmaticrowSorter.setSortKeys(...)calls are bridged back to Vaadin via the listener (which callsgrid.sort(translated)so the Grid's sort indicator stays in sync). -
getRowHeight
public int getRowHeight() -
setRowHeight
public void setRowHeight(int rowHeight) -
getRowHeight
public int getRowHeight(int row) -
setRowHeight
public void setRowHeight(int row, int rowHeight) -
getRowMargin
public int getRowMargin() -
setRowMargin
public void setRowMargin(int rowMargin) -
getIntercellSpacing
-
setIntercellSpacing
-
getGridColor
-
setGridColor
-
getShowHorizontalLines
public boolean getShowHorizontalLines() -
setShowHorizontalLines
public void setShowHorizontalLines(boolean showHorizontalLines) -
getShowVerticalLines
public boolean getShowVerticalLines() -
setShowVerticalLines
public void setShowVerticalLines(boolean showVerticalLines) -
getShowGrid
public boolean getShowGrid() -
setShowGrid
public void setShowGrid(boolean showGrid) -
getAutoResizeMode
public int getAutoResizeMode() -
setAutoResizeMode
public void setAutoResizeMode(int mode) -
getSelectionForeground
-
setSelectionForeground
-
getSelectionBackground
-
setSelectionBackground
-
getCellRect
-
getDragEnabled
public boolean getDragEnabled() -
setDragEnabled
public void setDragEnabled(boolean dragEnabled) -
getFillsViewportHeight
public boolean getFillsViewportHeight() -
setFillsViewportHeight
public void setFillsViewportHeight(boolean fillsViewportHeight) -
getPreferredScrollableViewportSize
-
setPreferredScrollableViewportSize
-
editCellAt
public void editCellAt(int row, int column) -
editCellAt
-
isEditing
public boolean isEditing() -
getEditingRow
public int getEditingRow() -
getEditingColumn
public int getEditingColumn() -
getEditorComponent
public com.vaadin.flow.component.Component getEditorComponent() -
removeEditor
public void removeEditor() -
addMouseListener
Overrides the inheritedComponentMixinwire — Grid dispatches item clicks carrying the row item + clicked column, not generic component clicks. EachSMouseListenergets two Grid subscriptions combined into oneRegistration:addItemClickListenerfiresSMouseEvent.MOUSE_CLICKEDwith the browser click count,addItemDoubleClickListenerfires it withclickCount == 2— the double-click-to-edit/open idiom. The clicked row (the Grid item, consistent withgetSelectedRow()/getValueAt(int, int)) and the view-column index are stashed around the fan-out sorowAtPoint(Point)/columnAtPoint(Point)resolve during the user'smouseClickedhandler (R_layouts_close_enough — no pixel→cell map). Mirrors SJList (SD_sjlist); columnAtPoint is the bonus Grid's item-click column affords that SJList didn't need.- Specified by:
addMouseListenerin interfaceComponentMixin
-
rowAtPoint
Row index of the cell currently being click-dispatched (stashed byaddMouseListener(SMouseListener)'s item-click wire), or-1outside a dispatch. Consistent withgetSelectedRow()/getValueAt(int, int)— there is no server-side pixel→row map (R_layouts_close_enough). Graduates from the pre-(b) drop-and-WARN. -
columnAtPoint
View-column index of the cell currently being click-dispatched, or-1(outside a dispatch, or a row-only click that carries no column). Resolved from the Grid's clicked column (R_layouts_close_enough). -
getUIClassID
Description copied from interface:JComponentMixinDeliberate no-op — L&F key.- Specified by:
getUIClassIDin interfaceJComponentMixin
-