Skip to content

Commit 5d7ce6a

Browse files
committed
fix: fix implementation of isReadOnly
Close #119
1 parent 2b11744 commit 5d7ce6a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public enum Orientation {
153153
private Label fakeButtonContainerLabel = new Label();
154154

155155
private Orientation orientation = Orientation.HORIZONTAL;
156-
156+
157157
private boolean autoResize = false;
158158

159159
private boolean isFromClient = false;
@@ -837,7 +837,7 @@ public Registration addValueChangeListener(
837837

838838
@Override
839839
public boolean isReadOnly() {
840-
return getAvailableGrid().getSelectionModel() == SelectionMode.NONE;
840+
return getAvailableGrid().getSelectionModel() instanceof GridNoneSelectionModel;
841841
}
842842

843843
@Override
@@ -1076,7 +1076,7 @@ private Button createActionButton() {
10761076
button.addThemeName("twin-col-grid-button");
10771077
return button;
10781078
}
1079-
1079+
10801080
/**
10811081
* Return whether autoResize is set or not.
10821082
*/
@@ -1086,19 +1086,19 @@ public boolean isAutoResize() {
10861086

10871087
/**
10881088
* Sets whether component should update orientation on resize.
1089-
*
1089+
*
10901090
* @param autoResize if true, component will update orientation on resize
10911091
*/
10921092
public void setAutoResize(boolean autoResize) {
10931093
if (autoResize != this.autoResize) {
10941094
if (autoResize) {
1095-
this.getElement().executeJs("fcTwinColGridAutoResize.observe($0)", this);
1095+
getElement().executeJs("fcTwinColGridAutoResize.observe($0)", this);
10961096
} else {
1097-
this.getElement().executeJs("fcTwinColGridAutoResize.unobserve($0)", this);
1097+
getElement().executeJs("fcTwinColGridAutoResize.unobserve($0)", this);
10981098
}
10991099
this.autoResize = autoResize;
11001100
}
1101-
}
1101+
}
11021102

11031103
/**
11041104
* Sets whether a doubleclick event immediately moves an item to the other grid
@@ -1133,5 +1133,5 @@ private void updateOrientationOnResize(int width, int height) {
11331133
this.withOrientation(Orientation.HORIZONTAL);
11341134
}
11351135
}
1136-
1136+
11371137
}

0 commit comments

Comments
 (0)