[Patch][gui] javax.swing.text.JTextComponent

Michael Koch konqueror@gmx.de
Thu Dec 16 16:11:00 GMT 2004


Hi list,


I just commited the attached patch to add handling of the
focusAccelerator property to javax.swing.text.JTextComponent.


Michael


2004-12-16  Michael Koch  <konqueror@gmx.de>

	* javax/swing/text/JTextComponent.java
	(focusAccelerator): New variable.
	(getFocusAccelerator): New method.
	(setFocusAccelerator): Likewise.

-------------- next part --------------
Index: javax/swing/text/JTextComponent.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/text/JTextComponent.java,v
retrieving revision 1.4.2.26
diff -u -r1.4.2.26 JTextComponent.java
--- javax/swing/text/JTextComponent.java	15 Dec 2004 09:14:28 -0000	1.4.2.26
+++ javax/swing/text/JTextComponent.java	16 Dec 2004 15:45:34 -0000
@@ -650,6 +650,7 @@
   private static DefaultTransferHandler defaultTransferHandler;
   private static Hashtable keymaps = new Hashtable();
   private Keymap keymap;
+  private char focusAccelerator = '\0';
   
   /**
    * Get a Keymap from the global keymap table, by name.
@@ -1495,4 +1496,19 @@
 					action.getValue(Action.NAME).toString());
     action.actionPerformed(event);
   }
+
+  public void setFocusAccelerator(char newKey)
+  {
+    if (focusAccelerator == newKey)
+      return;
+
+    char oldKey = focusAccelerator;
+    focusAccelerator = newKey;
+    firePropertyChange(FOCUS_ACCELERATOR_KEY, oldKey, newKey);
+  }
+  
+  public char getFocusAccelerator()
+  {
+    return focusAccelerator;
+  }
 }


More information about the Java-patches mailing list