Skip to content

Commit

Permalink
Remove context row header items
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrunyon committed Jun 7, 2024
1 parent 8854c27 commit 42c9387
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 52 deletions.
2 changes: 0 additions & 2 deletions plugins/ui/src/deephaven/ui/components/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def table(
show_search: bool = False,
context_items: list[ContextMenuItem] | None = None,
context_column_header_items: list[ContextMenuItem] | None = None,
context_row_header_items: list[ContextMenuItem] | None = None,
) -> UITable:
"""
Customization to how a table is displayed, how it behaves, and listen to UI events.
Expand Down Expand Up @@ -54,7 +53,6 @@ def table(
show_search: Whether to show the search bar by default.
context_items: The context menu items to show when a cell is right clicked. May contain action items or submenu items.
context_column_header_items: The context menu items to show when a column header is right clicked. May contain action items or submenu items.
context_row_header_items: The context menu items to show when a row header is right clicked. May contain action items or submenu items.
"""
props = locals()
del props["table"]
Expand Down
40 changes: 0 additions & 40 deletions plugins/ui/src/deephaven/ui/elements/UITable.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@
AggregationOperation,
QuickFilterExpression,
Color,
ContextMenuAction,
CellIndex,
CellPressCallback,
ColumnPressCallback,
RowData,
ContextMenuMode,
DataBarAxis,
DataBarValuePlacement,
DataBarDirection,
Expand Down Expand Up @@ -307,42 +303,6 @@ def color_row(
"""
raise NotImplementedError()

def context_menu(
self,
items: (
ContextMenuAction
| list[ContextMenuAction]
| Callable[
[CellIndex, RowData], ContextMenuAction | list[ContextMenuAction]
]
),
mode: ContextMenuMode = "CELL",
) -> "UITable":
"""
Add custom items to the context menu.
You can provide a list of actions that always appear,
or a callback that can process the selection and send back menu items asynchronously.
You can also specify whether you want the menu items provided for a cell context menu,
a header context menu, or some combination of those.
You can also chain multiple sets of menu items by calling `.context_menu` multiple times.
Args:
items: The items to add to the context menu.
May be a single `ContextMenuAction`, a list of `ContextMenuAction` objects,
or a callback function that takes the cell index and row data and returns either a single
`ContextMenuAction` or a list of `ContextMenuAction` objects.
mode: Which specific context menu(s) to add the menu item(s) to.
Can be one or more modes.
Using `None` will add menu items in all cases.
`CELL`: Triggered from a cell.
`ROW_HEADER`: Triggered from a row header.
`COLUMN_HEADER`: Triggered from a column header.
Returns:
A new UITable
"""
raise NotImplementedError()

def data_bar(
self,
col: str,
Expand Down
5 changes: 1 addition & 4 deletions plugins/ui/src/js/src/elements/UITable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ function UITable({
showQuickFilters,
contextItems,
contextColumnHeaderItems,
contextRowHeaderItems,
}: UITableProps): JSX.Element | null {
const dh = useApi();
const irisGridRef = useRef<IrisGridType>(null);
Expand Down Expand Up @@ -127,8 +126,7 @@ function UITable({
irisGrid,
model,
contextItems,
contextColumnHeaderItems,
contextRowHeaderItems
contextColumnHeaderItems
),
] as readonly GridMouseHandler[])
: undefined,
Expand All @@ -144,7 +142,6 @@ function UITable({
onRowDoublePress,
contextItems,
contextColumnHeaderItems,
contextRowHeaderItems,
]
);

Expand Down
6 changes: 1 addition & 5 deletions plugins/ui/src/js/src/elements/UITableContextMenuHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,18 @@ class UITableContextMenuHandler extends IrisGridContextMenuHandler {

private contextColumnHeaderItems: UITableProps['contextColumnHeaderItems'];

private contextRowHeaderItems: UITableProps['contextRowHeaderItems'];

constructor(
dh: typeof DhType,
irisGrid: IrisGridType,
model: IrisGridModel,
contextMenuItems: UITableProps['contextItems'],
contextColumnHeaderItems: UITableProps['contextColumnHeaderItems'],
contextRowHeaderItems: UITableProps['contextRowHeaderItems']
contextColumnHeaderItems: UITableProps['contextColumnHeaderItems']
) {
super(irisGrid, dh);
this.irisGrid = irisGrid;
this.model = model;
this.contextMenuItems = contextMenuItems;
this.contextColumnHeaderItems = contextColumnHeaderItems;
this.contextRowHeaderItems = contextRowHeaderItems;
}

getHeaderActions(
Expand Down
1 change: 0 additions & 1 deletion plugins/ui/src/js/src/elements/UITableUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export interface UITableProps {
showQuickFilters: boolean;
contextItems?: UIContextItem[];
contextColumnHeaderItems?: UIContextItem[];
contextRowHeaderItems?: UIContextItem[];
[key: string]: unknown;
}

Expand Down

0 comments on commit 42c9387

Please sign in to comment.