diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-21 21:41:28 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-21 21:41:28 +0000 |
commit | c5a0b6a9f05336761d47331a341e3da2c82b9099 (patch) | |
tree | 8dc82cf159a778b3a2ad143079c2b8ecf82b7b33 /libjava/java/awt/Checkbox.java | |
parent | 65ce19bc5f34c6c79cddf817741cf797a3fcb3c5 (diff) | |
download | ppe42-gcc-c5a0b6a9f05336761d47331a341e3da2c82b9099.tar.gz ppe42-gcc-c5a0b6a9f05336761d47331a341e3da2c82b9099.zip |
2005-02-21 Michael Koch <konqueror@gmx.de>
* java/awt/Checkbox.java
(next_checkbox_number): New static variable.
(generateName): New method.
(getUniqueLong): Likewise.
* java/awt/Window.java
(next_window_number): New static variable.
(generateName): New method.
(getUniqueLong): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95354 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/awt/Checkbox.java')
-rw-r--r-- | libjava/java/awt/Checkbox.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/libjava/java/awt/Checkbox.java b/libjava/java/awt/Checkbox.java index b3fc4c24d0a..2a8b62afd05 100644 --- a/libjava/java/awt/Checkbox.java +++ b/libjava/java/awt/Checkbox.java @@ -1,5 +1,5 @@ /* Checkbox.java -- An AWT checkbox widget - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -95,6 +95,11 @@ private boolean state; // The list of listeners for this object. private transient ItemListener item_listeners; + /* + * The number used to generate the name returned by getName. + */ + private static transient long next_checkbox_number; + /** * This class provides accessibility support for the * checkbox. @@ -106,7 +111,6 @@ protected class AccessibleAWTCheckbox extends AccessibleAWTComponent implements ItemListener, AccessibleAction, AccessibleValue { - /** * Serialization constant to match JDK 1.5 */ @@ -627,4 +631,18 @@ public AccessibleContext getAccessibleContext() return accessibleContext; } -} // class Checkbox + /** + * Generate a unique name for this checkbox. + * + * @return A unique name for this checkbox. + */ + String generateName() + { + return "checkbox" + getUniqueLong(); + } + + private static synchronized long getUniqueLong() + { + return next_checkbox_number++; + } +} |