Issue #19: Dropdown Menu by Table
5 unresolved threads
5 unresolved threads
Merge request reports
Activity
Filter activity
changed title from Issue # 19 to Issue #19 (closed)
404 408 // gridlayer 405 409 final GridLayer gridLayer = new GridLayer(bodyLayerStack, 406 410 columnGroup4HeaderLayer, rowHeaderLayer, cornerLayer); 407 natTable = new NatTable(parent, gridLayer); 411 natTable = new NatTable(parent, gridLayer, false); 408 412 GridDataFactory.fillDefaults().grab(true, true).minSize(-1, 500) 409 413 .applyTo(natTable); 414 tableMenuService.createDefaultMenuItems(this, table, bodyDataProvider, 415 selectionLayer); 416 natTable.addConfiguration(tableMenuService 417 .createMenuConfiguration(natTable, selectionLayer)); 78 @Override 79 public String getObjectGuid() { 80 final Collection<ILayerCell> selectedCells = selectionLayer 81 .getSelectedCells(); 82 if (selectedCells.isEmpty()) { 83 return null; 84 } 85 final int rowPosition = selectedCells.iterator().next() 86 .getRowPosition(); 87 final List<TableRow> tableRows = TableExtensions 88 .getTableRows(table); 89 return TableRowExtensions.getLeadingObjectGuid( 90 tableRows.get(rowPosition)); 91 } 92 93 }); 63 return popupMenu; 64 } 65 66 @Override 67 public void configureUiBindings(final UiBindingRegistry uiBindingRegistry) { 68 uiBindingRegistry.registerMouseDownBinding( 69 new MouseEventMatcher(SWT.NONE, GridRegion.BODY, 70 MouseEventMatcher.RIGHT_BUTTON), 71 new PopupMenuAction(bodyMenu) { 72 73 @Override 74 public void run(final NatTable natTable, 75 final MouseEvent event) { 76 if (selectionLayer.getSelectedCells().isEmpty()) { 77 return; 78 } 55 this.selectionLayer = selectionLayer; 56 this.bodyMenu = createBodyMenu(natTable, menuItems).build(); 57 } 58 59 protected static PopupMenuBuilder createBodyMenu(final NatTable natTable, 60 final Set<IMenuItemProvider> menuItems) { 61 final PopupMenuBuilder popupMenu = new PopupMenuBuilder(natTable); 62 menuItems.forEach(popupMenu::withMenuItemProvider); 63 return popupMenu; 64 } 65 66 @Override 67 public void configureUiBindings(final UiBindingRegistry uiBindingRegistry) { 68 uiBindingRegistry.registerMouseDownBinding( 69 new MouseEventMatcher(SWT.NONE, GridRegion.BODY, 70 MouseEventMatcher.RIGHT_BUTTON), 55 56 protected void createShowInTextViewItem(final String label, 57 final ToolboxEvent toolboxEvent) { 58 this.menuItems.add(createMenuItem(label, new SelectionAdapter() { 59 @Override 60 public void widgetSelected(final SelectionEvent e) { 61 62 if (tableBodyMenuConfiguration.selectionLayer.getSelectedCells() 63 .isEmpty()) { 64 return; 65 } 66 toolboxPartService.showPart(SOURCE_TEXT_VIEWER_PART_ID); 67 ToolboxEvents.send(broker, toolboxEvent); 68 } 69 })); 70 } changed title from Issue #19 (closed) to Issue #19 (closed): Dropdown Menu by Table
added 10 commits
-
1a429c9e...67b54d9a - 4 commits from branch
eclipse/set:main
- 692ffd69 - Merge branch 'main' of https://gitlab.eclipse.org/eclipse/set/set into main
- 3725bb6d - Merge branch 'main' of https://gitlab.eclipse.org/eclipse/set/set into main
- 31fe2dbc - Merge branch 'main' of https://gitlab.eclipse.org/eclipse/set/set into main
- 60408c8a - #19 (closed) Dropdown nenu by table
- 7ae9cbed - Merge branch 'issue#19' of https://gitlab.eclipse.org/ntruongg36/set into issue#19
- 1946d396 - select row by right click
Toggle commit list-
1a429c9e...67b54d9a - 4 commits from branch