You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/java/com/vaadin/flow/component/contextmenu/ContextMenuBase.java
+98-21
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@
15
15
*/
16
16
packagecom.vaadin.flow.component.contextmenu;
17
17
18
+
importjava.util.Collection;
18
19
importjava.util.List;
19
20
importjava.util.stream.Stream;
20
21
@@ -203,17 +204,10 @@ public void close() {
203
204
/**
204
205
* Adds a new item component with the given text content to the context menu
205
206
* overlay.
206
-
* <p>
207
-
* This is a convenience method for the use case where you have a list of
208
-
* highlightable {@link MenuItem}s inside the overlay. If you want to
209
-
* configure the contents of the overlay without wrapping them inside
210
-
* {@link MenuItem}s, or if you just want to add some non-highlightable
211
-
* components between the items, use the {@link #add(Component...)} method.
212
207
*
213
208
* @param text
214
209
* the text content for the created menu item
215
210
* @return the created menu item
216
-
* @see #add(Component...)
217
211
*/
218
212
publicIaddItem(Stringtext) {
219
213
returngetMenuManager().addItem(text);
@@ -222,17 +216,10 @@ public I addItem(String text) {
222
216
/**
223
217
* Adds a new item component with the given component to the context menu
224
218
* overlay.
225
-
* <p>
226
-
* This is a convenience method for the use case where you have a list of
227
-
* highlightable {@link MenuItem}s inside the overlay. If you want to
228
-
* configure the contents of the overlay without wrapping them inside
229
-
* {@link MenuItem}s, or if you just want to add some non-highlightable
230
-
* components between the items, use the {@link #add(Component...)} method.
231
219
*
232
220
* @param component
233
221
* the component to add to the created menu item
234
222
* @return the created menu item
235
-
* @see #add(Component...)
236
223
*/
237
224
publicIaddItem(Componentcomponent) {
238
225
returngetMenuManager().addItem(component);
@@ -241,10 +228,6 @@ public I addItem(Component component) {
241
228
/**
242
229
* Adds the given components into the context menu overlay.
243
230
* <p>
244
-
* For the common use case of having a list of high-lightable items inside
245
-
* the overlay, you can use the {@link #addItem(String)} convenience methods
246
-
* instead.
247
-
* <p>
248
231
* The added elements in the DOM will not be children of the
249
232
* {@code <vaadin-context-menu>} element, but will be inserted into an
250
233
* overlay that is attached into the {@code <body>}.
@@ -253,23 +236,98 @@ public I addItem(Component component) {
0 commit comments