public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* Patch: BasicLookAndFeel initComponentDefaults
@ 2005-12-21 20:23 Lillian Angel
  2005-12-21 20:30 ` Roman Kennke
  0 siblings, 1 reply; 4+ messages in thread
From: Lillian Angel @ 2005-12-21 20:23 UTC (permalink / raw)
  To: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

2005-12-20  Lillian Angel  <langel@redhat.com>

        * gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/
	initComponentDefaults.java:
        Added checks for TextArea.focusInputMap, 
	TextField.focusInputMap, TextPane.focusInputMap, and 
	PasswordField.focusInputMap.


[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 2916 bytes --]

Index: gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java	27 Sep 2005 18:36:26 -0000	1.5
+++ gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java	21 Dec 2005 20:20:37 -0000	1.6
@@ -36,6 +36,7 @@
 import javax.swing.KeyStroke;
 import javax.swing.ListCellRenderer;
 import javax.swing.UIDefaults;
+import javax.swing.UIManager;
 import javax.swing.border.Border;
 import javax.swing.plaf.BorderUIResource;
 import javax.swing.plaf.ColorUIResource;
@@ -251,6 +252,7 @@
     harness.check(defaults.get("PasswordField.caretBlinkRate"), new Integer(500));
     harness.check(defaults.get("PasswordField.font"), new FontUIResource("MonoSpaced", Font.PLAIN, 12));
     harness.check(defaults.get("PasswordField.margin"), new InsetsUIResource(0, 0, 0, 0));
+    harness.check(UIManager.get("PasswordField.focusInputMap") instanceof InputMapUIResource);
     
     harness.checkPoint("PopupMenu");
     harness.check(defaults.get("PopupMenu.border") instanceof BorderUIResource.CompoundBorderUIResource);
@@ -389,12 +391,14 @@
     harness.check(defaults.get("TextArea.caretBlinkRate"), new Integer(500));
     harness.check(defaults.get("TextArea.font"), new FontUIResource("MonoSpaced", Font.PLAIN, 12));
     harness.check(defaults.get("TextArea.margin"), new InsetsUIResource(0, 0, 0, 0));
+    harness.check(UIManager.get("TextArea.focusInputMap") instanceof InputMapUIResource);
     
     harness.checkPoint("TextField");
     harness.check(defaults.get("TextField.border") instanceof BasicBorders.FieldBorder);
     harness.check(defaults.get("TextField.caretBlinkRate"), new Integer(500));
     harness.check(defaults.get("TextField.font"), new FontUIResource("SansSerif", Font.PLAIN, 12));
     harness.check(defaults.get("TextField.margin"), new InsetsUIResource(0, 0, 0, 0));
+    harness.check(UIManager.get("TextField.focusInputMap") instanceof InputMapUIResource);
     
     harness.checkPoint("TextPane");
     harness.check(defaults.get("TextPane.background"), new ColorUIResource(255, 255, 255));
@@ -402,6 +406,7 @@
     harness.check(defaults.get("TextPane.caretBlinkRate"), new Integer(500));
     harness.check(defaults.get("TextPane.font"), new FontUIResource("Serif", Font.PLAIN, 12));
     harness.check(defaults.get("TextPane.margin"), new InsetsUIResource(3, 3, 3, 3));
+    harness.check(UIManager.get("TextPane.focusInputMap") instanceof InputMapUIResource);
     
     harness.checkPoint("TitledBorder");
     harness.check(defaults.get("TitledBorder.border") instanceof BorderUIResource.EtchedBorderUIResource);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Patch: BasicLookAndFeel initComponentDefaults
  2005-12-21 20:23 Patch: BasicLookAndFeel initComponentDefaults Lillian Angel
@ 2005-12-21 20:30 ` Roman Kennke
  2005-12-21 22:15   ` Lillian Angel
  0 siblings, 1 reply; 4+ messages in thread
From: Roman Kennke @ 2005-12-21 20:30 UTC (permalink / raw)
  To: Lillian Angel; +Cc: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]

Hi Lillian,

Am Mittwoch, den 21.12.2005, 15:23 -0500 schrieb Lillian Angel:
> 2005-12-20  Lillian Angel  <langel@redhat.com>
> 
>         * gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/
> 	initComponentDefaults.java:
>         Added checks for TextArea.focusInputMap, 
> 	TextField.focusInputMap, TextPane.focusInputMap, and 
> 	PasswordField.focusInputMap.
> 


+    harness.check(UIManager.get("PasswordField.focusInputMap")
instanceof InputMapUIResource);

The test could be a little more detailed. I know that lots of tests in
this test class are like you did. You have implemented ~27 keybindings
for each text component, it would be helpful to check all of them.
Sorry, it's alot of work (ok, lots of copy+pasting ;-) ), but it's
really worth the effort. So, what should be done is, check for the type
and size of the Object[] value for this key, and do a check for each
keystroke and binding in the array (for KeyStrokes I would do a
harness.check(keystroke.toString(), "ctrl ENTER") kind of check (to
avoid confusion, because both (String and KeyStroke objects) are legal
for the KeyStroke part, for the binding a simple harness.check(binding,
"notify-accept") kind of check will do. Would you mind adding such
checks?

/Roman


[-- Attachment #2: Dies ist ein digital signierter Nachrichtenteil --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Patch: BasicLookAndFeel initComponentDefaults
  2005-12-21 20:30 ` Roman Kennke
@ 2005-12-21 22:15   ` Lillian Angel
  2005-12-22 14:36     ` FYI: " Lillian Angel
  0 siblings, 1 reply; 4+ messages in thread
From: Lillian Angel @ 2005-12-21 22:15 UTC (permalink / raw)
  To: Roman Kennke; +Cc: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]

On Wed, 2005-12-21 at 21:30 +0100, Roman Kennke wrote:
> Hi Lillian,
> 
> Am Mittwoch, den 21.12.2005, 15:23 -0500 schrieb Lillian Angel:
> > 2005-12-20  Lillian Angel  <langel@redhat.com>
> > 
> >         * gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/
> > 	initComponentDefaults.java:
> >         Added checks for TextArea.focusInputMap, 
> > 	TextField.focusInputMap, TextPane.focusInputMap, and 
> > 	PasswordField.focusInputMap.
> > 
> 
> 
> +    harness.check(UIManager.get("PasswordField.focusInputMap")
> instanceof InputMapUIResource);
> 
> The test could be a little more detailed. I know that lots of tests in
> this test class are like you did. You have implemented ~27 keybindings
> for each text component, it would be helpful to check all of them.
> Sorry, it's alot of work (ok, lots of copy+pasting ;-) ), but it's
> really worth the effort. So, what should be done is, check for the type
> and size of the Object[] value for this key, and do a check for each
> keystroke and binding in the array (for KeyStrokes I would do a
> harness.check(keystroke.toString(), "ctrl ENTER") kind of check (to
> avoid confusion, because both (String and KeyStroke objects) are legal
> for the KeyStroke part, for the binding a simple harness.check(binding,
> "notify-accept") kind of check will do. Would you mind adding such
> checks?

Done!

2005-12-20  Lillian Angel  <langel@redhat.com>

        *
gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java:
        Added more detailed tests for focusInputMaps.


[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 18309 bytes --]

Index: gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java,v
retrieving revision 1.6
diff -u -r1.6 initComponentDefaults.java
--- gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java	21 Dec 2005 20:20:37 -0000	1.6
+++ gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java	21 Dec 2005 22:12:57 -0000
@@ -253,6 +253,43 @@
     harness.check(defaults.get("PasswordField.font"), new FontUIResource("MonoSpaced", Font.PLAIN, 12));
     harness.check(defaults.get("PasswordField.margin"), new InsetsUIResource(0, 0, 0, 0));
     harness.check(UIManager.get("PasswordField.focusInputMap") instanceof InputMapUIResource);
+    Object o = UIManager.get("PasswordField.focusInputMap");
+    InputMapUIResource im = (InputMapUIResource) o;
+    KeyStroke[] k = im.keys();
+    harness.check(k.length == 33);
+    harness.check(im.get(KeyStroke.getKeyStroke("END")), "caret-end-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift ctrl O")), "toggle-componentOrientation");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift KP_LEFT")), "selection-backward");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift RIGHT")), "selection-forward");
+	harness.check(im.get(KeyStroke.getKeyStroke("HOME")), "caret-begin-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("ctrl V")), "paste-from-clipboard");
+	harness.check(im.get(KeyStroke.getKeyStroke("ctrl H")), "delete-previous");
+	harness.check(im.get(KeyStroke.getKeyStroke("KP_LEFT")), "caret-backward");
+	harness.check(im.get(KeyStroke.getKeyStroke("LEFT")), "caret-backward");
+	harness.check(im.get(KeyStroke.getKeyStroke("ctrl X")), "cut-to-clipboard");
+	harness.check(im.get(KeyStroke.getKeyStroke("KP_RIGHT")), "caret-forward");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift ctrl KP_RIGHT")), "selection-end-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("COPY")), "copy-to-clipboard");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift HOME")), "selection-begin-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("RIGHT")), "caret-forward");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift ctrl LEFT")), "selection-begin-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("ctrl KP_LEFT")), "caret-begin-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("ctrl KP_RIGHT")), "caret-end-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("PASTE")), "paste-from-clipboard");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift ctrl RIGHT")), "selection-end-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("ctrl BACK_SLASH")), "unselect");
+	harness.check(im.get(KeyStroke.getKeyStroke("ctrl A")), "select-all");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift KP_RIGHT")), "selection-forward");
+	harness.check(im.get(KeyStroke.getKeyStroke("CUT")), "cut-to-clipboard");
+	harness.check(im.get(KeyStroke.getKeyStroke("ctrl LEFT")), "caret-begin-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("BACK_SPACE")), "delete-previous");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift ctrl KP_LEFT")), "selection-begin-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("ctrl C")), "copy-to-clipboard");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift END")), "selection-end-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("ctrl RIGHT")), "caret-end-line");
+	harness.check(im.get(KeyStroke.getKeyStroke("DELETE")), "delete-next");
+	harness.check(im.get(KeyStroke.getKeyStroke("ENTER")), "notify-field-accept");
+	harness.check(im.get(KeyStroke.getKeyStroke("shift LEFT")), "selection-backward");
     
     harness.checkPoint("PopupMenu");
     harness.check(defaults.get("PopupMenu.border") instanceof BorderUIResource.CompoundBorderUIResource);
@@ -392,6 +429,64 @@
     harness.check(defaults.get("TextArea.font"), new FontUIResource("MonoSpaced", Font.PLAIN, 12));
     harness.check(defaults.get("TextArea.margin"), new InsetsUIResource(0, 0, 0, 0));
     harness.check(UIManager.get("TextArea.focusInputMap") instanceof InputMapUIResource);
+    Object ta = UIManager.get("TextPane.focusInputMap");
+    InputMapUIResource taim = (InputMapUIResource) ta;
+    harness.check(taim.keys().length == 55);
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift UP")), "selection-up");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl RIGHT")), "caret-next-word");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift ctrl LEFT")), "selection-previous-word");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift KP_UP")), "selection-up");
+    harness.check(taim.get(KeyStroke.getKeyStroke("DOWN")), "caret-down");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift ctrl T")), "previous-link-action");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl LEFT")), "caret-previous-word");
+    harness.check(taim.get(KeyStroke.getKeyStroke("CUT")), "cut-to-clipboard");
+    harness.check(taim.get(KeyStroke.getKeyStroke("END")), "caret-end-line");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift PAGE_UP")), "selection-page-up");
+    harness.check(taim.get(KeyStroke.getKeyStroke("KP_UP")), "caret-up");
+    harness.check(taim.get(KeyStroke.getKeyStroke("DELETE")), "delete-next");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl HOME")), "caret-begin");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift LEFT")), "selection-backward");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl END")), "caret-end");
+    harness.check(taim.get(KeyStroke.getKeyStroke("BACK_SPACE")), "delete-previous");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift ctrl RIGHT")), "selection-next-word");
+    harness.check(taim.get(KeyStroke.getKeyStroke("LEFT")), "caret-backward");
+    harness.check(taim.get(KeyStroke.getKeyStroke("KP_LEFT")), "caret-backward");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift KP_RIGHT")), "selection-forward");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl SPACE")), "activate-link-action");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl H")), "delete-previous");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl BACK_SLASH")), "unselect");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ENTER")), "insert-break");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift HOME")), "selection-begin-line");
+    harness.check(taim.get(KeyStroke.getKeyStroke("RIGHT")), "caret-forward");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift ctrl PAGE_UP")), "selection-page-left");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift DOWN")), "selection-down");
+    harness.check(taim.get(KeyStroke.getKeyStroke("PAGE_DOWN")), "page-down");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift KP_LEFT")), "selection-backward");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift ctrl O")), "toggle-componentOrientation");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl X")), "cut-to-clipboard");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift ctrl PAGE_DOWN")), "selection-page-right");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl C")), "copy-to-clipboard");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl KP_RIGHT")), "caret-next-word");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift END")), "selection-end-line");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl KP_LEFT")), "caret-previous-word");
+    harness.check(taim.get(KeyStroke.getKeyStroke("HOME")), "caret-begin-line");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl V")), "paste-from-clipboard");
+    harness.check(taim.get(KeyStroke.getKeyStroke("KP_DOWN")), "caret-down");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl A")), "select-all");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift RIGHT")), "selection-forward");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift ctrl END")), "selection-end");
+    harness.check(taim.get(KeyStroke.getKeyStroke("COPY")), "copy-to-clipboard");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift ctrl KP_LEFT")), "selection-previous-word");
+    harness.check(taim.get(KeyStroke.getKeyStroke("ctrl T")), "next-link-action");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift KP_DOWN")), "selection-down");
+    harness.check(taim.get(KeyStroke.getKeyStroke("TAB")), "insert-tab");
+    harness.check(taim.get(KeyStroke.getKeyStroke("UP")), "caret-up");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift ctrl HOME")), "selection-begin");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift PAGE_DOWN")), "selection-page-down");
+    harness.check(taim.get(KeyStroke.getKeyStroke("KP_RIGHT")), "caret-forward");
+    harness.check(taim.get(KeyStroke.getKeyStroke("shift ctrl KP_RIGHT")), "selection-next-word");
+    harness.check(taim.get(KeyStroke.getKeyStroke("PAGE_UP")), "page-up");
+    harness.check(taim.get(KeyStroke.getKeyStroke("PASTE")), "paste-from-clipboard");   
     
     harness.checkPoint("TextField");
     harness.check(defaults.get("TextField.border") instanceof BasicBorders.FieldBorder);
@@ -399,7 +494,43 @@
     harness.check(defaults.get("TextField.font"), new FontUIResource("SansSerif", Font.PLAIN, 12));
     harness.check(defaults.get("TextField.margin"), new InsetsUIResource(0, 0, 0, 0));
     harness.check(UIManager.get("TextField.focusInputMap") instanceof InputMapUIResource);
-    
+    Object tf = UIManager.get("TextPane.focusInputMap");
+    InputMapUIResource tfim = (InputMapUIResource) tf;
+    harness.check(tfim.keys().length == 55);
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ENTER")), "insert-break");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("LEFT")), "caret-backward");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("RIGHT")), "caret-forward");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("BACK_SPACE")), "delete-previous");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ctrl X")), "cut-to-clipboard");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ctrl C")), "copy-to-clipboard");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ctrl V")), "paste-from-clipboard");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift LEFT")), "selection-backward");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift RIGHT")), "selection-forward");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("HOME")), "caret-begin-line");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("END")), "caret-end-line");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("DELETE")), "delete-next");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift ctrl O")), "toggle-componentOrientation");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift KP_LEFT")), "selection-backward");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ctrl H")), "delete-previous");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("KP_LEFT")), "caret-backward");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("KP_RIGHT")), "caret-forward");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift ctrl KP_RIGHT")), "selection-next-word");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("COPY")), "copy-to-clipboard");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift HOME")), "selection-begin-line");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift ctrl LEFT")), "selection-previous-word");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ctrl KP_LEFT")), "caret-previous-word");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ctrl KP_RIGHT")), "caret-next-word");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("PASTE")), "paste-from-clipboard");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift ctrl RIGHT")), "selection-next-word");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ctrl BACK_SLASH")), "unselect");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ctrl A")), "select-all");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift KP_RIGHT")), "selection-forward");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("CUT")), "cut-to-clipboard");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ctrl LEFT")), "caret-previous-word");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift ctrl KP_LEFT")), "selection-previous-word");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("shift END")), "selection-end-line");
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ctrl RIGHT")), "caret-next-word");
+	
     harness.checkPoint("TextPane");
     harness.check(defaults.get("TextPane.background"), new ColorUIResource(255, 255, 255));
     harness.check(defaults.get("TextPane.border") instanceof BasicBorders.MarginBorder);
@@ -407,6 +538,64 @@
     harness.check(defaults.get("TextPane.font"), new FontUIResource("Serif", Font.PLAIN, 12));
     harness.check(defaults.get("TextPane.margin"), new InsetsUIResource(3, 3, 3, 3));
     harness.check(UIManager.get("TextPane.focusInputMap") instanceof InputMapUIResource);
+    Object tp = UIManager.get("TextPane.focusInputMap");
+    InputMapUIResource tpim = (InputMapUIResource) tp;
+    harness.check(tpim.keys().length == 55);
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift UP")), "selection-up"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl RIGHT")), "caret-next-word"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift ctrl LEFT")), "selection-previous-word"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift KP_UP")), "selection-up"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("DOWN")), "caret-down"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift ctrl T")), "previous-link-action"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl LEFT")), "caret-previous-word"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("CUT")), "cut-to-clipboard"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("END")), "caret-end-line"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift PAGE_UP")), "selection-page-up"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("KP_UP")), "caret-up"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("DELETE")), "delete-next"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl HOME")), "caret-begin"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift LEFT")), "selection-backward"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl END")), "caret-end"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("BACK_SPACE")), "delete-previous"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift ctrl RIGHT")), "selection-next-word"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("LEFT")), "caret-backward"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("KP_LEFT")), "caret-backward"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift KP_RIGHT")), "selection-forward"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl SPACE")), "activate-link-action"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl H")), "delete-previous"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl BACK_SLASH")), "unselect"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ENTER")), "insert-break"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift HOME")), "selection-begin-line"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("RIGHT")), "caret-forward"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift ctrl PAGE_UP")), "selection-page-left"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift DOWN")), "selection-down"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("PAGE_DOWN")), "page-down"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift KP_LEFT")), "selection-backward"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift ctrl O")), "toggle-componentOrientation"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl X")), "cut-to-clipboard"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift ctrl PAGE_DOWN")), "selection-page-right"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl C")), "copy-to-clipboard"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl KP_RIGHT")), "caret-next-word"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift END")), "selection-end-line"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl KP_LEFT")), "caret-previous-word"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("HOME")), "caret-begin-line"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl V")), "paste-from-clipboard"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("KP_DOWN")), "caret-down"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl A")), "select-all"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift RIGHT")), "selection-forward"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift ctrl END")), "selection-end"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("COPY")), "copy-to-clipboard"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift ctrl KP_LEFT")), "selection-previous-word"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("ctrl T")), "next-link-action"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift KP_DOWN")), "selection-down"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("TAB")), "insert-tab"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("UP")), "caret-up"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift ctrl HOME")), "selection-begin"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift PAGE_DOWN")), "selection-page-down"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("KP_RIGHT")), "caret-forward"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("shift ctrl KP_RIGHT")), "selection-next-word"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("PAGE_UP")), "page-up"); 
+    harness.check(tpim.get(KeyStroke.getKeyStroke("PASTE")), "paste-from-clipboard");
     
     harness.checkPoint("TitledBorder");
     harness.check(defaults.get("TitledBorder.border") instanceof BorderUIResource.EtchedBorderUIResource);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: FYI: BasicLookAndFeel initComponentDefaults
  2005-12-21 22:15   ` Lillian Angel
@ 2005-12-22 14:36     ` Lillian Angel
  0 siblings, 0 replies; 4+ messages in thread
From: Lillian Angel @ 2005-12-22 14:36 UTC (permalink / raw)
  To: Roman Kennke; +Cc: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 1853 bytes --]


2005-12-20  Lillian Angel  <langel@redhat.com>

        *
gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java:
        Fixed a couple of typos.


On Wed, 2005-12-21 at 17:15 -0500, Lillian Angel wrote:
> On Wed, 2005-12-21 at 21:30 +0100, Roman Kennke wrote:
> > Hi Lillian,
> > 
> > Am Mittwoch, den 21.12.2005, 15:23 -0500 schrieb Lillian Angel:
> > > 2005-12-20  Lillian Angel  <langel@redhat.com>
> > > 
> > >         * gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/
> > > 	initComponentDefaults.java:
> > >         Added checks for TextArea.focusInputMap, 
> > > 	TextField.focusInputMap, TextPane.focusInputMap, and 
> > > 	PasswordField.focusInputMap.
> > > 
> > 
> > 
> > +    harness.check(UIManager.get("PasswordField.focusInputMap")
> > instanceof InputMapUIResource);
> > 
> > The test could be a little more detailed. I know that lots of tests in
> > this test class are like you did. You have implemented ~27 keybindings
> > for each text component, it would be helpful to check all of them.
> > Sorry, it's alot of work (ok, lots of copy+pasting ;-) ), but it's
> > really worth the effort. So, what should be done is, check for the type
> > and size of the Object[] value for this key, and do a check for each
> > keystroke and binding in the array (for KeyStrokes I would do a
> > harness.check(keystroke.toString(), "ctrl ENTER") kind of check (to
> > avoid confusion, because both (String and KeyStroke objects) are legal
> > for the KeyStroke part, for the binding a simple harness.check(binding,
> > "notify-accept") kind of check will do. Would you mind adding such
> > checks?
> 
> Done!
> 
> 2005-12-20  Lillian Angel  <langel@redhat.com>
> 
>         *
> gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java:
>         Added more detailed tests for focusInputMaps.
> 

[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 2471 bytes --]

Index: gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java,v
retrieving revision 1.7
diff -u -r1.7 initComponentDefaults.java
--- gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java	21 Dec 2005 22:15:35 -0000	1.7
+++ gnu/testlet/javax/swing/plaf/basic/BasicLookAndFeel/initComponentDefaults.java	22 Dec 2005 14:33:48 -0000
@@ -46,7 +46,6 @@
 import javax.swing.plaf.InsetsUIResource;
 import javax.swing.plaf.BorderUIResource.CompoundBorderUIResource;
 import javax.swing.plaf.basic.BasicBorders;
-import javax.swing.plaf.basic.BasicLookAndFeel;
 import javax.swing.plaf.basic.BasicBorders.ButtonBorder;
 import javax.swing.plaf.basic.BasicBorders.MarginBorder;
 
@@ -429,7 +428,7 @@
     harness.check(defaults.get("TextArea.font"), new FontUIResource("MonoSpaced", Font.PLAIN, 12));
     harness.check(defaults.get("TextArea.margin"), new InsetsUIResource(0, 0, 0, 0));
     harness.check(UIManager.get("TextArea.focusInputMap") instanceof InputMapUIResource);
-    Object ta = UIManager.get("TextPane.focusInputMap");
+    Object ta = UIManager.get("TextArea.focusInputMap");
     InputMapUIResource taim = (InputMapUIResource) ta;
     harness.check(taim.keys().length == 55);
     harness.check(taim.get(KeyStroke.getKeyStroke("shift UP")), "selection-up");
@@ -494,10 +493,10 @@
     harness.check(defaults.get("TextField.font"), new FontUIResource("SansSerif", Font.PLAIN, 12));
     harness.check(defaults.get("TextField.margin"), new InsetsUIResource(0, 0, 0, 0));
     harness.check(UIManager.get("TextField.focusInputMap") instanceof InputMapUIResource);
-    Object tf = UIManager.get("TextPane.focusInputMap");
+    Object tf = UIManager.get("TextField.focusInputMap");
     InputMapUIResource tfim = (InputMapUIResource) tf;
-    harness.check(tfim.keys().length == 55);
-    harness.check(tfim.get(KeyStroke.getKeyStroke("ENTER")), "insert-break");
+    harness.check(tfim.keys().length == 33);
+    harness.check(tfim.get(KeyStroke.getKeyStroke("ENTER")), "notify-field-accept");
     harness.check(tfim.get(KeyStroke.getKeyStroke("LEFT")), "caret-backward");
     harness.check(tfim.get(KeyStroke.getKeyStroke("RIGHT")), "caret-forward");
     harness.check(tfim.get(KeyStroke.getKeyStroke("BACK_SPACE")), "delete-previous");

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-12-22 14:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-21 20:23 Patch: BasicLookAndFeel initComponentDefaults Lillian Angel
2005-12-21 20:30 ` Roman Kennke
2005-12-21 22:15   ` Lillian Angel
2005-12-22 14:36     ` FYI: " Lillian Angel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).