diff options
Diffstat (limited to 'src/macosx/classes/sun/lwawt/LWTextFieldPeer.java')
-rw-r--r-- | src/macosx/classes/sun/lwawt/LWTextFieldPeer.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java b/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java index ef2b4d087..fb3c43d5d 100644 --- a/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java +++ b/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,6 +37,10 @@ import java.awt.peer.TextFieldPeer; import javax.swing.*; import javax.swing.text.JTextComponent; +/** + * Lightweight implementation of {@link TextFieldPeer}. Delegates most of the + * work to the {@link JPasswordField}. + */ final class LWTextFieldPeer extends LWTextComponentPeer<TextField, JPasswordField> implements TextFieldPeer, ActionListener { @@ -47,7 +51,7 @@ final class LWTextFieldPeer } @Override - protected JPasswordField createDelegate() { + JPasswordField createDelegate() { return new JPasswordFieldDelegate(); } @@ -107,7 +111,7 @@ final class LWTextFieldPeer * @param e the focus event */ @Override - protected void handleJavaFocusEvent(final FocusEvent e) { + void handleJavaFocusEvent(final FocusEvent e) { if (e.getID() == FocusEvent.FOCUS_LOST) { // In order to de-select the selection setCaretPosition(0); @@ -115,6 +119,7 @@ final class LWTextFieldPeer super.handleJavaFocusEvent(e); } + @SuppressWarnings("serial")// Safe: outer class is non-serializable. private final class JPasswordFieldDelegate extends JPasswordField { // Empty non private constructor was added because access to this |