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
refactor: remove duplication code in ContextMenuManager (#8285)
Move the logic to create `SpreadsheetActionDetails` from `Action` to a
helper method. The only difference was the `type` value assigned to each
of them, so it makes sense to pass this value as parameter to the helper
method.
Copy file name to clipboardExpand all lines: vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow/src/main/java/com/vaadin/flow/component/spreadsheet/ContextMenuManager.java
+55-25Lines changed: 55 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@
13
13
importjava.util.LinkedList;
14
14
15
15
importorg.apache.poi.ss.util.CellRangeAddress;
16
+
importorg.jsoup.Jsoup;
17
+
importorg.jsoup.safety.Safelist;
16
18
importorg.slf4j.Logger;
17
19
importorg.slf4j.LoggerFactory;
18
20
@@ -42,6 +44,23 @@ public class ContextMenuManager implements Serializable {
42
44
43
45
privateintcontextMenuHeaderIndex = -1;
44
46
47
+
/**
48
+
* Enum for spreadsheet action types.
49
+
*/
50
+
enumActionType {
51
+
CELL(0), ROW(1), COLUMN(2);
52
+
53
+
privatefinalintvalue;
54
+
55
+
ActionType(intvalue) {
56
+
this.value = value;
57
+
}
58
+
59
+
publicintgetValue() {
60
+
returnvalue;
61
+
}
62
+
}
63
+
45
64
/**
46
65
* Constructs a new ContextMenuManager and ties it to the given Spreadsheet.
47
66
*
@@ -216,19 +235,11 @@ public void onActionOnColumnHeader(String actionKey) {
Copy file name to clipboardExpand all lines: vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow/src/main/java/com/vaadin/flow/component/spreadsheet/client/SpreadsheetActionDetails.java
0 commit comments