diff options
author | Leif Åstrand <leif@vaadin.com> | 2015-09-18 14:26:50 +0300 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2015-12-16 07:18:37 +0000 |
commit | 3aff803172dab49a6e0ac694b3b3d687dc7e976c (patch) | |
tree | 469ac91e564baf88852bb73460194b07cf381134 /client | |
parent | 61e83653330399f6ead49f74277410e43368a2cb (diff) | |
download | vaadin-framework-3aff803172dab49a6e0ac694b3b3d687dc7e976c.tar.gz vaadin-framework-3aff803172dab49a6e0ac694b3b3d687dc7e976c.zip |
Make it possible to only show collapsible columns in menu (#9811)
Change-Id: I52cd2648d305f44d5688e7a2fcd222e6b167b97b
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VScrollTable.java | 19 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/table/TableConnector.java | 1 |
2 files changed, 16 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 5bd6ed390d..74966d6b26 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -104,6 +104,7 @@ import com.vaadin.client.ui.dd.VTransferable; import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.dd.VerticalDropLocation; +import com.vaadin.shared.ui.table.CollapseMenuContent; import com.vaadin.shared.ui.table.TableConstants; /** @@ -4018,10 +4019,17 @@ public class VScrollTable extends FlowPanel implements HasWidgets, cols[i++] = it.next(); } } - final Action[] actions = new Action[cols.length]; + List<Action> actions = new ArrayList<Action>(cols.length); for (int i = 0; i < cols.length; i++) { final String cid = (String) cols[i]; + boolean noncollapsible = noncollapsibleColumns.contains(cid); + + if (noncollapsible + && collapsibleMenuContent == CollapseMenuContent.COLLAPSIBLE_COLUMNS) { + continue; + } + final HeaderCell c = getHeaderCell(cid); final VisibleColumnAction a = new VisibleColumnAction( c.getColKey()); @@ -4029,12 +4037,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (!c.isEnabled()) { a.setCollapsed(true); } - if (noncollapsibleColumns.contains(cid)) { + if (noncollapsible) { a.setNoncollapsible(true); } - actions[i] = a; + actions.add(a); } - return actions; + return actions.toArray(new Action[actions.size()]); } @Override @@ -7205,6 +7213,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** For internal use only. May be removed or replaced in the future. */ public boolean multiselectPending; + /** For internal use only. May be removed or replaced in the future. */ + public CollapseMenuContent collapsibleMenuContent; + /** * @return border top + border bottom of the scrollable area of table */ diff --git a/client/src/com/vaadin/client/ui/table/TableConnector.java b/client/src/com/vaadin/client/ui/table/TableConnector.java index cdd9397976..a554b9335c 100644 --- a/client/src/com/vaadin/client/ui/table/TableConnector.java +++ b/client/src/com/vaadin/client/ui/table/TableConnector.java @@ -395,6 +395,7 @@ public class TableConnector extends AbstractFieldConnector implements getWidget().rendering = false; getWidget().headerChangedDuringUpdate = false; + getWidget().collapsibleMenuContent = getState().collapseMenuContent; } @Override |