Skip to content

Commit 3b92b22

Browse files
authored
feat: Use Jackson and Elemental for serialisation
vaadin/spreadsheet#828 * feat: serialization of CellData * test: disable tests * wip: serialization of event data * feat: use flow serilization for event data * feat: serialization of SpreadsheetActionDetails * feat: remove extra argument in client RPC methods * feat: serialization of MergedRegion (property) * feat: serialization of OverlayInfo * feat: add set parser * feat: serialize InvalidFormula * feat: add serializers for parseMapStringString * feat: serialization of parseMapStringString * feat: serialization of Map<String,String> float[] and int[] * feat: refactor serializers * feat: serialize ArrayList<String> and Set<Integer> * feat: serialize HashMap<Integer, Integer> and String[] * feat: serialize PopupButtonState and GroupingData * feat: cleanup old serializer and parser * test: fix serialization tests * chore: remove leftovers
1 parent fcb3730 commit 3b92b22

18 files changed

Lines changed: 366 additions & 915 deletions

File tree

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/CellData.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515

1616
import java.io.Serializable;
1717

18+
import jsinterop.annotations.JsType;
19+
1820
@SuppressWarnings("serial")
21+
@JsType
1922
public class CellData implements Serializable {
2023

2124
public int row;

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/MergedRegion.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,23 @@
1515

1616
import java.io.Serializable;
1717

18+
import jsinterop.annotations.JsIgnore;
19+
import jsinterop.annotations.JsType;
20+
1821
@SuppressWarnings("serial")
22+
@JsType
1923
public class MergedRegion implements Serializable {
2024
public int id;
2125
public int col1;
2226
public int col2;
2327
public int row1;
2428
public int row2;
2529

30+
@JsIgnore
2631
public MergedRegion() {
2732
}
2833

34+
@JsIgnore
2935
public MergedRegion(int c1, int r1, int c2, int r2) {
3036
col1 = c1;
3137
row1 = r1;

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/OverlayInfo.java‎

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,20 @@
1515

1616
import java.io.Serializable;
1717

18+
import jsinterop.annotations.JsType;
19+
1820
@SuppressWarnings("serial")
21+
@JsType
1922
public class OverlayInfo implements Serializable {
20-
public enum Type {
21-
IMAGE,
22-
COMPONENT
23-
};
2423

25-
public OverlayInfo() {
26-
}
27-
28-
public OverlayInfo(Type t) {
29-
type = t;
30-
}
24+
public final static String IMAGE = "IMAGE";
25+
public final static String COMPONENT = "COMPONENT";
3126

32-
public Type type = Type.IMAGE;
33-
27+
public String type = IMAGE;
3428
public int col;
3529
public int row;
3630
public float width;
3731
public float height;
3832
public float dy;
3933
public float dx;
40-
41-
@Override
42-
public String toString() {
43-
return type.name() + "#" + col + "#" + row + "#" + width + "#" + height + "#" + dx + "#" + dy;
44-
}
4534
}

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/PopupButtonState.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
* %%
99
* This program is available under Commercial Vaadin Developer License
1010
* 4.0 (CVDLv4).
11-
*
11+
*
1212
* For the full License, see <https://vaadin.com/license/cvdl-4.0>.
1313
* #L%
1414
*/
1515

1616
import com.vaadin.shared.AbstractComponentState;
1717

18+
import jsinterop.annotations.JsType;
19+
1820
@SuppressWarnings("serial")
21+
@JsType
1922
public class PopupButtonState extends AbstractComponentState {
2023

2124
/** 1-based */

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/SpreadsheetActionDetails.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@
1515

1616
import java.io.Serializable;
1717

18+
import jsinterop.annotations.JsType;
19+
1820
@SuppressWarnings("serial")
21+
@JsType
1922
public class SpreadsheetActionDetails implements Serializable {
2023
public String caption;
2124
public String key;
22-
/** 0 = cell, 1 = row, 2 = column TODO replace with enum type */
25+
/** 0 = cell, 1 = row, 2 = column */
2326
public int type;
2427
}

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/SpreadsheetClientRpc.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public interface SpreadsheetClientRpc extends ClientRpc {
3737

3838
void invalidCellAddress();
3939

40-
void showSelectedCell(String name, int col, int row, String cellValue, boolean function,
40+
void showSelectedCell(String name, int col, int row, String cellValue, boolean formula,
4141
boolean locked, boolean initialSelection);
4242

4343
/**

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/client/SpreadsheetConnector.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
import com.vaadin.shared.communication.ServerRpc;
4747
import com.vaadin.shared.communication.SharedState;
4848
import com.vaadin.spreadsheet.flowport.gwtexporter.client.SpreadsheetServerRpcImpl;
49+
import static com.vaadin.addon.spreadsheet.client.OverlayInfo.IMAGE;
50+
import static com.vaadin.addon.spreadsheet.client.OverlayInfo.COMPONENT;
4951

5052
@SuppressWarnings("serial")
5153
public class SpreadsheetConnector extends AbstractHasComponentsConnector

‎vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-client/src/main/java/com/vaadin/addon/spreadsheet/shared/GroupingData.java‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@
88
* %%
99
* This program is available under Commercial Vaadin Developer License
1010
* 4.0 (CVDLv4).
11-
*
11+
*
1212
* For the full License, see <https://vaadin.com/license/cvdl-4.0>.
1313
* #L%
1414
*/
1515

1616
import java.io.Serializable;
1717

18+
import jsinterop.annotations.JsIgnore;
19+
import jsinterop.annotations.JsType;
20+
1821
/**
1922
* Shared state for the grouping feature
2023
*/
24+
@SuppressWarnings("serial")
25+
@JsType
2126
public class GroupingData implements Serializable {
2227
public int startIndex;
2328
public int endIndex;
@@ -28,14 +33,17 @@ public class GroupingData implements Serializable {
2833
public int uniqueIndex;
2934
public boolean collapsed;
3035

36+
@JsIgnore
3137
public GroupingData() {
3238
}
3339

40+
@JsIgnore
3441
public GroupingData(long start, long end, short level, long unique,
3542
boolean coll) {
3643
this((int) start, (int) end, (int) level, (int) unique, coll);
3744
}
3845

46+
@JsIgnore
3947
public GroupingData(int start, int end, int level, int unique, boolean coll) {
4048
startIndex = start;
4149
endIndex = end;

0 commit comments

Comments
 (0)