You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/10/02 16:25:16 UTC

svn commit: r821033 - in /incubator/pivot/trunk: tutorials/src/org/apache/pivot/tutorials/menus/ tutorials/www/ wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtk/skin/ wtk/src/org/apache/pivot/wtk/skin/terra/

Author: gbrown
Date: Fri Oct  2 14:25:15 2009
New Revision: 821033

URL: http://svn.apache.org/viewvc?rev=821033&view=rev
Log:
Add command key handling to other components (including TextInput); add clipboard tutorial documentation.

Modified:
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/menus/MenuBars.java
    incubator/pivot/trunk/tutorials/www/clipboard.template.html
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Keyboard.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInput.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTextInputSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTreeViewSkin.java

Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/menus/MenuBars.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/menus/MenuBars.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/menus/MenuBars.java (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/menus/MenuBars.java Fri Oct  2 14:25:15 2009
@@ -76,6 +76,7 @@
 
                 tabPane.getTabs().add(tab);
                 TabPane.setLabel(tab, "Document " + tabPane.getTabs().getLength());
+                tabPane.setSelectedIndex(tabPane.getTabs().getLength() - 1);
             }
         });
 

Modified: incubator/pivot/trunk/tutorials/www/clipboard.template.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/clipboard.template.html?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/clipboard.template.html (original)
+++ incubator/pivot/trunk/tutorials/www/clipboard.template.html Fri Oct  2 14:25:15 2009
@@ -33,7 +33,9 @@
 </head>
 <body>
 <h1>Clipboard</h1>
-<p>This section is not yet complete.</p>
+<p>The clipboard is a shared storage area that can be used to transfer data within an application or between multiple applications. Content placed on the clipboard can be copied (or "pasted") into another section of an application or into a completely different application.</p>
+
+<p>The following application demonstrates the use of the clipboard. It is signed to allow it to access the system clipboard; untrusted Pivot applications can only perform copy and paste with a local clipboard whose content is not shared with other applications.</p>
 
 <script>
 var attributes = {code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
@@ -48,5 +50,196 @@
 deployJava.writeAppletTag(attributes, parameters);
 </script>
 
+<p>The application source code consists of two files: a main WTKX file that declares the structure of the user interface along with some simple event handlers, and a JavaScript file that defines two functions: <tt>copy()</tt> and <tt>paste()</tt>. These functions are invoked by the button press listeners attached to the UI elements declared in the WTKX file. The WTKX source code for the example is shown below:</p>
+
+<pre class="brush:xml">
+&lt;Window title="Clipboard" maximized="true"
+    xmlns:wtkx="http://pivot.apache.org/wtkx"
+    xmlns="org.apache.pivot.wtk"&gt;
+    &lt;wtkx:script src="clipboard.js"/&gt;
+
+    &lt;windowStateListeners&gt;
+        &lt;wtkx:script&gt;
+        &lt;![CDATA[
+        function windowOpened(window) {
+            sourceImageButtonGroup.setSelection(sourceImageButton1);
+            sourceImageButton1.requestFocus();
+        }
+        ]]&gt;
+        &lt;/wtkx:script&gt;
+    &lt;/windowStateListeners&gt;
+
+    &lt;content&gt;
+        &lt;TablePane styles="{horizontalSpacing:4, verticalSpacing:4}"&gt;
+            &lt;columns&gt;
+                &lt;TablePane.Column width="1*"/&gt;
+                &lt;TablePane.Column width="1*"/&gt;
+            &lt;/columns&gt;
+            &lt;rows&gt;
+                &lt;TablePane.Row height="1*"&gt;
+                    &lt;Border&gt;
+                        &lt;content&gt;
+                            &lt;CardPane wtkx:id="sourceImageCardPane" styles="{padding:4}"&gt;
+                                &lt;ImageView image="org/apache/pivot/tutorials/IMG_0725_2.jpg"/&gt;
+                                &lt;ImageView image="org/apache/pivot/tutorials/IMG_0735_2.jpg"/&gt;
+                                &lt;ImageView image="org/apache/pivot/tutorials/IMG_0767_2.jpg"/&gt;
+                            &lt;/CardPane&gt;
+                        &lt;/content&gt;
+                    &lt;/Border&gt;
+                    &lt;Border&gt;
+                        &lt;content&gt;
+                            &lt;CardPane selectedIndex="0" styles="{padding:4}"&gt;
+                                &lt;ImageView wtkx:id="destinationImageView"/&gt;
+                            &lt;/CardPane&gt;
+                        &lt;/content&gt;
+                    &lt;/Border&gt;
+                &lt;/TablePane.Row&gt;
+
+                &lt;TablePane.Row height="-1"&gt;
+                    &lt;BoxPane orientation="vertical" styles="{fill:true}"&gt;
+                        &lt;BoxPane wtkx:id="sourceImageButtonBoxPane"
+                            styles="{horizontalAlignment:'center', verticalAlignment:'center'}"&gt;
+                            &lt;wtkx:define&gt;
+                                &lt;ButtonGroup wtkx:id="sourceImageButtonGroup"&gt;
+                                    &lt;buttonGroupListeners&gt;
+                                        &lt;wtkx:script&gt;
+                                        &lt;![CDATA[
+                                        function selectionChanged(buttonGroup, previousSelection) {
+                                            var selection = buttonGroup.getSelection();
+
+                                            if (selection != null) {
+                                                var index = sourceImageButtonBoxPane.indexOf(selection);
+                                                sourceImageCardPane.setSelectedIndex(index);
+                                            }
+                                        }
+                                        ]]&gt;
+                                        &lt;/wtkx:script&gt;
+                                    &lt;/buttonGroupListeners&gt;
+                                &lt;/ButtonGroup&gt;
+                            &lt;/wtkx:define&gt;
+
+                            &lt;PushButton wtkx:id="sourceImageButton1"
+                                buttonData="IMG_0725_2.jpg" toggleButton="true"
+                                buttonGroup="$sourceImageButtonGroup"/&gt;
+                            &lt;PushButton wtkx:id="sourceImageButton2"
+                                buttonData="IMG_0735_2.jpg" toggleButton="true"
+                                buttonGroup="$sourceImageButtonGroup"/&gt;
+                            &lt;PushButton wtkx:id="sourceImageButton3"
+                                buttonData="IMG_0767_2.jpg" toggleButton="true"
+                                buttonGroup="$sourceImageButtonGroup"/&gt;
+                        &lt;/BoxPane&gt;
+
+                        &lt;BoxPane styles="{horizontalAlignment:'center'}"&gt;
+                            &lt;PushButton wtkx:id="copyButton" buttonData="Copy"
+                                ButtonPressListener.buttonPressed="copy()"/&gt;
+                        &lt;/BoxPane&gt;
+                    &lt;/BoxPane&gt;
+
+                    &lt;BoxPane styles="{horizontalAlignment:'center', verticalAlignment:'center'}"&gt;
+                        &lt;PushButton wtkx:id="pasteButton" buttonData="Paste"
+                            ButtonPressListener.buttonPressed="paste()"/&gt;
+                    &lt;/BoxPane&gt;
+                &lt;/TablePane.Row&gt;
+            &lt;/rows&gt;
+        &lt;/TablePane&gt;
+    &lt;/content&gt;
+&lt;/Window&gt;
+</pre>
+
+<p>Like most Pivot tutorial examples, it defines a single top-level, maximized, undecorated <tt>Window</tt> instance that contains the rest of the UI. The source images are contained in a set of <tt>ImageView</tt> components stored in a <tt>CardPane</tt>, and a set of toggle-style <tt>PushButton</tt>s is used to navigate between them. Another <tt>ImageView</tt> is used to display the image content pasted from the clipboard.</p>
+
+<p>The file defines several event handlers:</p>
+
+<ul>
+<li>
+<p>A window state listener that initializes the selection of the card pane when the window is opened:</p>
+<pre class="xml">
+&lt;windowStateListeners&gt;
+    &lt;wtkx:script&gt;
+    &lt;![CDATA[
+    function windowOpened(window) {
+        sourceImageButtonGroup.setSelection(sourceImageButton1);
+        sourceImageButton1.requestFocus();
+    }
+    ]]&gt;
+    &lt;/wtkx:script&gt;
+&lt;/windowStateListeners&gt;
+</pre>
+</li>
+<li>
+<p>A button group listener that changes the card pane's selection in response to a button group selection change:</p>
+<pre class="xml">
+&lt;buttonGroupListeners&gt;
+    &lt;wtkx:script&gt;
+    &lt;![CDATA[
+    function selectionChanged(buttonGroup, previousSelection) {
+        var selection = buttonGroup.getSelection();
+
+        if (selection != null) {
+            var index = sourceImageButtonBoxPane.indexOf(selection);
+            sourceImageCardPane.setSelectedIndex(index);
+        }
+    }
+    ]]&gt;
+    &lt;/wtkx:script&gt;
+&lt;/buttonGroupListeners&gt;
+</pre>
+</li>
+<li>
+<p>A button press listener that calls the <tt>copy()</tt> function when the "Copy" button is pressed:</p>
+<pre class="xml">
+&lt;PushButton wtkx:id="copyButton" buttonData="Copy"
+    ButtonPressListener.buttonPressed="copy()"/&gt;
+</pre>
+</li>
+<li>
+<p>A button press listener that calls the <tt>paste()</tt> function when the "Paste" button is pressed:</p>
+<pre class="xml">
+&lt;PushButton wtkx:id="pasteButton" buttonData="Paste"
+    ButtonPressListener.buttonPressed="paste()"/&gt;
+</pre>
+</li>
+</ul>
+
+<p>Since all of the application's logic is implemented in script, there is no Java source file for this example. The contents of "clipboard.js" are shown below:</p>
+
+<pre class="brush:javascript">
+importPackage(org.apache.pivot.wtk);
+
+function copy() {
+    // Copy the selected image to the clipboard
+    var selectedSourceIndex = sourceImageCardPane.getSelectedIndex();
+    var sourceImageView = sourceImageCardPane.get(selectedSourceIndex);
+    var sourceImage = sourceImageView.getImage();
+
+    var content = new LocalManifest();
+    content.putImage(sourceImage);
+
+    Clipboard.setContent(content);
+}
+
+function paste() {
+    // Paste any available image from the clipboard
+    var content = Clipboard.getContent();
+
+    if (content != null) {
+        var image = content.getImage();
+
+        if (image != null) {
+            destinationImageView.setImage(image);
+        }
+    }
+}
+</pre>
+
+<p>These two functions perform the actual copying and pasting of the image data. The <tt>copy()</tt> function gets a reference to the actual image displayed by the selected card (an instance of <tt>org.apache.pivot.wtk.media.Image</tt>) and sets it as the "image" property of a <tt>LocalManifest</tt> instance. <tt>LocalManifest</tt> is a concrete implementation of the abstract <tt>Manifest</tt> class that is used to represent the source data in a clipboard transaction. In contrast, a <tt>RemoteManifest</tt> represents data obtained from the clipboard. Local manifests are created by an application, whereas remote manifests are created by the system.</p>
+
+<p>A manifest encapsulates the content that may be placed on the clipboard by a Pivot application. It can represent the data in a variety of "flavors": as text, as an image, as a list of files, as a URL, or as a custom data format. An application may provide one or more flavors depending on the nature of the data. An application that is interested in consuming the data can then choose the most appropriate format based on the available flavors.</p>
+
+<p>Once the manifest has been created and populated, it is placed on the clipboard via the <tt>Clipboard.setContent()</tt> method. It is now available for other applications to consume.</p>
+
+<p>The <tt>paste()</tt> method performs the opposite transaction. It retrieves the current clipboard contents and checks for the presence of an image flavor. If available, it extracts the image content and sets it as the source of the "destinationImageView" component.</p>
+
+<p>Next: <a href="drag_and_drop.html">Drag and Drop</a></p>
 </body>
 </html>

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java Fri Oct  2 14:25:15 2009
@@ -1278,28 +1278,32 @@
                     case KeyEvent.KEY_TYPED: {
                         boolean consumed = false;
 
-                        char keyChar = event.getKeyChar();
-
-                        try {
-                            if (focusedComponent == null) {
-                                if (application instanceof Application.UnprocessedKeyHandler) {
-                                    Application.UnprocessedKeyHandler unprocessedKeyHandler =
-                                        (Application.UnprocessedKeyHandler)application;
-                                    unprocessedKeyHandler.keyTyped(keyChar);
+                        // Don't fire key typed if a command key was pressed
+                        Keyboard.Modifier commandModifier = Keyboard.getCommandModifier();
+                        if (!Keyboard.isPressed(commandModifier)) {
+                            char keyChar = event.getKeyChar();
+
+                            try {
+                                if (focusedComponent == null) {
+                                    if (application instanceof Application.UnprocessedKeyHandler) {
+                                        Application.UnprocessedKeyHandler unprocessedKeyHandler =
+                                            (Application.UnprocessedKeyHandler)application;
+                                        unprocessedKeyHandler.keyTyped(keyChar);
+                                    }
+                                } else {
+                                    if (!focusedComponent.isBlocked()) {
+                                        consumed = focusedComponent.keyTyped(keyChar);
+                                    }
                                 }
-                            } else {
-                                if (!focusedComponent.isBlocked()) {
-                                    consumed = focusedComponent.keyTyped(keyChar);
+                            } catch (Exception exception) {
+                                if (application instanceof Application.UncaughtExceptionHandler) {
+                                    Application.UncaughtExceptionHandler uncaughtExceptionHandler =
+                                        (Application.UncaughtExceptionHandler)application;
+                                    uncaughtExceptionHandler.uncaughtExceptionThrown(exception);
+                                } else {
+                                    exception.printStackTrace();
                                 }
                             }
-                        } catch (Exception exception) {
-                            if (application instanceof Application.UncaughtExceptionHandler) {
-                                Application.UncaughtExceptionHandler uncaughtExceptionHandler =
-                                    (Application.UncaughtExceptionHandler)application;
-                                uncaughtExceptionHandler.uncaughtExceptionThrown(exception);
-                            } else {
-                                exception.printStackTrace();
-                            }
                         }
 
                         if (consumed) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Keyboard.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Keyboard.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Keyboard.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Keyboard.java Fri Oct  2 14:25:15 2009
@@ -249,17 +249,17 @@
 
     private static int modifiers = 0;
 
-    private static final Modifier MULTI_SELECT_MODIFIER;
+    private static final Modifier COMMAND_MODIFIER;
     private static final String KEYSTROKE_MODIFIER_SEPARATOR;
 
     static {
         String osName = System.getProperty("os.name").toLowerCase();
 
         if (osName.startsWith("mac os x")) {
-            MULTI_SELECT_MODIFIER = Modifier.META;
+            COMMAND_MODIFIER = Modifier.META;
             KEYSTROKE_MODIFIER_SEPARATOR = "";
         } else {
-            MULTI_SELECT_MODIFIER = Modifier.CTRL;
+            COMMAND_MODIFIER = Modifier.CTRL;
             KEYSTROKE_MODIFIER_SEPARATOR = "-";
         }
     }
@@ -314,8 +314,8 @@
         return dropAction;
     }
 
-    public static Modifier getMultiSelectModifier() {
-        return MULTI_SELECT_MODIFIER;
+    public static Modifier getCommandModifier() {
+        return COMMAND_MODIFIER;
     }
 
     public static String getKeyStrokeModifierSeparator() {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInput.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInput.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInput.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInput.java Fri Oct  2 14:25:15 2009
@@ -26,7 +26,6 @@
 import org.apache.pivot.wtk.text.TextNode;
 import org.apache.pivot.wtk.text.validation.Validator;
 
-
 /**
  * A component that allows a user to enter a single line of unformatted text.
  */

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java Fri Oct  2 14:25:15 2009
@@ -1483,6 +1483,7 @@
         if (textArea.isEditable()) {
             Document document = textArea.getDocument();
 
+            Keyboard.Modifier commandModifier = Keyboard.getCommandModifier();
             if (document != null) {
                 if (keyCode == Keyboard.KeyCode.ENTER) {
                     textArea.insertParagraph();
@@ -1563,7 +1564,7 @@
                     // TODO Make sure we scroll the next view to visible
 
                     consumed = true;
-                } else if (Keyboard.isPressed(Keyboard.Modifier.CTRL)) {
+                } else if (Keyboard.isPressed(commandModifier)) {
                     if (keyCode == Keyboard.KeyCode.A) {
                         textArea.setSelection(0, document.getCharacterCount());
                     } else if (keyCode == Keyboard.KeyCode.X) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java Fri Oct  2 14:25:15 2009
@@ -642,7 +642,8 @@
             Accordion accordion = (Accordion)getComponent();
             Accordion.PanelSequence panels = accordion.getPanels();
 
-            if (Keyboard.isPressed(Keyboard.Modifier.CTRL)) {
+            Keyboard.Modifier commandModifier = Keyboard.getCommandModifier();
+            if (Keyboard.isPressed(commandModifier)) {
                 int selectedIndex = -1;
 
                 switch (keyCode) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java Fri Oct  2 14:25:15 2009
@@ -671,8 +671,9 @@
     public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
         boolean consumed = super.keyReleased(component, keyCode, keyLocation);
 
+        Keyboard.Modifier commandModifier = Keyboard.getCommandModifier();
         if (keyCode == Keyboard.KeyCode.F
-            && Keyboard.isPressed(Keyboard.Modifier.CTRL)) {
+            && Keyboard.isPressed(commandModifier)) {
             searchTextInput.requestFocus();
             consumed = true;
         }

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java Fri Oct  2 14:25:15 2009
@@ -609,7 +609,7 @@
                         listView.setSelectedIndex(itemIndex);
                     }
                 } else {
-                    Keyboard.Modifier multiSelectModifier = Keyboard.getMultiSelectModifier();
+                    Keyboard.Modifier commandModifier = Keyboard.getCommandModifier();
 
                     if (Keyboard.isPressed(Keyboard.Modifier.SHIFT)
                         && selectMode == ListView.SelectMode.MULTI) {
@@ -627,7 +627,7 @@
 
                             listView.setSelectedRanges(selectedRanges);
                         }
-                    } else if (Keyboard.isPressed(multiSelectModifier)
+                    } else if (Keyboard.isPressed(commandModifier)
                         && selectMode == ListView.SelectMode.MULTI) {
                         // Toggle the item's selection state
                         if (listView.isItemSelected(itemIndex)) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java Fri Oct  2 14:25:15 2009
@@ -1084,8 +1084,9 @@
     public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
         boolean consumed = super.keyPressed(component, keyCode, keyLocation);
 
+        Keyboard.Modifier commandModifier = Keyboard.getCommandModifier();
         if (!consumed
-            && Keyboard.isPressed(Keyboard.Modifier.CTRL)) {
+            && Keyboard.isPressed(commandModifier)) {
             TabPane tabPane = (TabPane)getComponent();
             TabPane.TabSequence tabs = tabPane.getTabs();
 

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java Fri Oct  2 14:25:15 2009
@@ -1011,7 +1011,7 @@
                     tableView.setSelectedIndex(rowIndex);
                 }
             } else {
-                Keyboard.Modifier multiSelectModifier = Keyboard.getMultiSelectModifier();
+                Keyboard.Modifier commandModifier = Keyboard.getCommandModifier();
 
                 if (Keyboard.isPressed(Keyboard.Modifier.SHIFT)
                     && selectMode == TableView.SelectMode.MULTI) {
@@ -1029,7 +1029,7 @@
 
                         tableView.setSelectedRanges(selectedRanges);
                     }
-                } else if (Keyboard.isPressed(multiSelectModifier)
+                } else if (Keyboard.isPressed(commandModifier)
                     && selectMode == TableView.SelectMode.MULTI) {
                     // Toggle the item's selection state
                     if (tableView.isRowSelected(rowIndex)) {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTextInputSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTextInputSkin.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTextInputSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTextInputSkin.java Fri Oct  2 14:25:15 2009
@@ -1072,6 +1072,7 @@
         TextInput textInput = (TextInput)getComponent();
         TextNode textNode = textInput.getTextNode();
 
+        Keyboard.Modifier commandModifier = Keyboard.getCommandModifier();
         if (keyCode == Keyboard.KeyCode.DELETE
             || keyCode == Keyboard.KeyCode.BACKSPACE) {
             consumed = true;
@@ -1193,13 +1194,13 @@
             // Move the caret to the end of the text
             textInput.setSelection(textNode.getCharacterCount(), 0);
         } else if (keyCode == Keyboard.KeyCode.A
-            && Keyboard.isPressed(Keyboard.Modifier.CTRL)) {
+            && Keyboard.isPressed(commandModifier)) {
             consumed = true;
 
             // Select all
             textInput.setSelection(0, textNode.getCharacterCount());
         } else if (keyCode == Keyboard.KeyCode.X
-            && Keyboard.isPressed(Keyboard.Modifier.CTRL)) {
+            && Keyboard.isPressed(commandModifier)) {
             consumed = true;
 
             if (textInput.isPassword()) {
@@ -1208,7 +1209,7 @@
                 textInput.cut();
             }
         } else if (keyCode == Keyboard.KeyCode.C
-            && Keyboard.isPressed(Keyboard.Modifier.CTRL)) {
+            && Keyboard.isPressed(commandModifier)) {
             consumed = true;
 
             if (textInput.isPassword()) {
@@ -1217,7 +1218,7 @@
                 textInput.copy();
             }
         } else if (keyCode == Keyboard.KeyCode.V
-            && Keyboard.isPressed(Keyboard.Modifier.CTRL)) {
+            && Keyboard.isPressed(commandModifier)) {
             consumed = true;
 
             textInput.paste();

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTreeViewSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTreeViewSkin.java?rev=821033&r1=821032&r2=821033&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTreeViewSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTreeViewSkin.java Fri Oct  2 14:25:15 2009
@@ -1435,8 +1435,8 @@
                                     treeView.setSelectedPath(path);
                                 }
                             } else if (selectMode == TreeView.SelectMode.MULTI) {
-                                Keyboard.Modifier multiSelectModifier = Keyboard.getMultiSelectModifier();
-                                if (Keyboard.isPressed(multiSelectModifier)) {
+                                Keyboard.Modifier commandModifier = Keyboard.getCommandModifier();
+                                if (Keyboard.isPressed(commandModifier)) {
                                     if (nodeInfo.isSelected()) {
                                         treeView.removeSelectedPath(path);
                                     } else {