Author: rwhitcomb Date: Thu Jan 11 22:30:50 2018 New Revision: 1820938 URL: http://svn.apache.org/viewvc?rev=1820938&view=rev Log: PIVOT-1023: Implement Ctrl/Cmd-U to unselect everything in TableView skin. Update one test program to allow testing of the multi-select features.
Modified: pivot/trunk/tests/src/org/apache/pivot/tests/table_view_test2.bxml pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java Modified: pivot/trunk/tests/src/org/apache/pivot/tests/table_view_test2.bxml URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/table_view_test2.bxml?rev=1820938&r1=1820937&r2=1820938&view=diff ============================================================================== --- pivot/trunk/tests/src/org/apache/pivot/tests/table_view_test2.bxml (original) +++ pivot/trunk/tests/src/org/apache/pivot/tests/table_view_test2.bxml Thu Jan 11 22:30:50 2018 @@ -23,7 +23,7 @@ limitations under the License. xmlns="org.apache.pivot.wtk" > <ScrollPane horizontalScrollBarPolicy="fill_to_capacity"> - <TableView bxml:id="tableView" styles="{variableRowHeight:true, backgroundColor:'#ffeeee'}"> + <TableView bxml:id="tableView" selectMode="multi" styles="{variableRowHeight:true, backgroundColor:'#ffeeee'}"> <columns> <TableView.Column name="value" width="100"> <cellRenderer> Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java?rev=1820938&r1=1820937&r2=1820938&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java Thu Jan 11 22:30:50 2018 @@ -1267,6 +1267,7 @@ public class TerraTableViewSkin extends * {@link KeyCode#DOWN DOWN} Increases the selection size by including the * next enabled row when select mode is {@link SelectMode#MULTI}<br> * {@code Cmd/Ctrl-A} in {@link SelectMode#MULTI} select mode to select everything<br> + * {@code Cmd/Ctrl-U} will unselect whatever is selected<br> * {@link KeyCode#SPACE SPACE} wil select/unselect the "current" location */ @Override @@ -1361,6 +1362,23 @@ public class TerraTableViewSkin extends } } break; + } + + case Keyboard.KeyCode.U: { + Modifier cmdModifier = Platform.getCommandModifier(); + if (Keyboard.isPressed(cmdModifier)) { + switch (selectMode) { + case NONE: + break; + case SINGLE: + case MULTI: + tableView.clearSelection(); + lastKeyboardSelectIndex = 0; // TODO: what should it be? + consumed = true; + break; + } + } + break; } default: {