@@ -0,0 +1,3446 @@
+/*%0A *  Licensed to the Apache Software Foundation (ASF) under one or more%0A *  contributor license agreements.  See the NOTICE file distributed with%0A *  this work for additional information regarding copyright ownership.%0A *  The ASF licenses this file to You under the Apache License, Version 2.0%0A *  (the %22License%22); you may not use this file except in compliance with%0A *  the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing, software%0A *  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  See the License for the specific language governing permissions and%0A *  limitations under the License.%0A */%0A/**%0A * @author Evgeniya G. Maenkova%0A * @version $Revision$%0A */%0Apackage javax.swing;%0A%0Aimport javax.accessibility.AccessibleContext;%0Aimport javax.accessibility.AccessibleRole;%0Aimport javax.swing.text.Document;%0A%0Aimport org.apache.harmony.awt.ComponentInternals;%0Aimport org.apache.harmony.x.swing.StringConstants;%0A%0A%0Apublic class JPasswordField extends JTextField %7B%0A    protected class AccessibleJPasswordField extends AccessibleJTextField %7B%0A        public AccessibleRole getAccessibleRole() %7B%0A             return AccessibleRole.PASSWORD_TEXT;%0A        %7D%0A    %7D%0A%0A    final class PasswordTextKit extends TextFieldKitImpl %7B%0A        public boolean echoCharIsSet() %7B%0A            return JPasswordField.this.echoCharIsSet();%0A        %7D%0A%0A        public char getEchoChar() %7B%0A            return JPasswordField.this.getEchoChar();%0A        %7D%0A    %7D%0A%0A    private static final String uiClassID = %22PasswordFieldUI%22;%0A    private static final char zeroEcho = '%5C0';%0A    private char echoChar = '*';%0A%0A    public JPasswordField() %7B%0A        this(null, null, 0);%0A    %7D%0A%0A    public JPasswordField(final String text, final int columns) %7B%0A        this(null, text, columns);%0A    %7D%0A%0A    public JPasswordField(final String text) %7B%0A        this(null, text, 0);%0A    %7D%0A%0A    public JPasswordField(final int columns) %7B%0A        this(null, null, columns);%0A    %7D%0A%0A    public JPasswordField(final Document document,%0A                          final String text,%0A                          final int columns) %7B%0A        super(document, text, columns);%0A        installTextKit();%0A    %7D%0A%0A    void installTextKit() %7B%0A        ComponentInternals.getComponentInternals()%0A            .setTextFieldKit(this, new PasswordTextKit());%0A    %7D%0A%0A    public void copy() %7B%0A        UIManager.getLookAndFeel().provideErrorFeedback(this);%0A    %7D%0A%0A    public void cut() %7B%0A        UIManager.getLookAndFeel().provideErrorFeedback(this);%0A    %7D%0A%0A    public boolean echoCharIsSet() %7B%0A        return echoChar != zeroEcho;%0A    %7D%0A%0A    public AccessibleContext getAccessibleContext() %7B%0A        if (accessibleContext == null) %7B%0A            accessibleContext = new AccessibleJPasswordField();%0A        %7D%0A        return accessibleContext;%0A    %7D%0A%0A    public char getEchoChar() %7B%0A        return echoChar;%0A    %7D%0A%0A    public String getUIClassID() %7B%0A        return uiClassID;%0A    %7D%0A%0A    public char%5B%5D getPassword() %7B%0A        return getText().toCharArray();%0A    %7D%0A%0A    public void setEchoChar(final char echoChar) %7B%0A        char oldValue = this.echoChar;%0A        this.echoChar = echoChar;%0A        firePropertyChange(StringConstants.PASSWORD_FIELD_ECHO_CHAR_PROPERTY,%0A                           oldValue, echoChar);%0A    %7D%0A%7D%0A%0A

Patch for HARMONY-2997 "[swing] field javax.swing.JPasswordField.accessibleContext is missing"