src/macosx/classes/sun/lwawt/LWTextAreaPeer.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -42,11 +42,11 @@
 import javax.swing.text.Document;
 import javax.swing.text.JTextComponent;
 
 /**
  * Lightweight implementation of {@link TextAreaPeer}. Delegates most of the
- * work to the {@link JTextArea} inside JScrollPane.
+ * work to the {@link JTextArea} inside {@link JScrollPane}.
  */
 final class LWTextAreaPeer
         extends LWTextComponentPeer<TextArea, LWTextAreaPeer.ScrollableJTextArea>
         implements TextAreaPeer {
 

@@ -64,11 +64,11 @@
                    final PlatformComponent platformComponent) {
         super(target, platformComponent);
     }
 
     @Override
-    protected ScrollableJTextArea createDelegate() {
+    ScrollableJTextArea createDelegate() {
         return new ScrollableJTextArea();
     }
 
     @Override
     void initializeImpl() {

@@ -83,20 +83,20 @@
     JTextComponent getTextComponent() {
         return getDelegate().getView();
     }
 
     @Override
-    protected Cursor getCursor(final Point p) {
+    Cursor getCursor(final Point p) {
         final boolean isContains;
         synchronized (getDelegateLock()) {
             isContains = getDelegate().getViewport().getBounds().contains(p);
         }
         return isContains ? super.getCursor(p) : null;
     }
 
     @Override
-    protected Component getDelegateFocusOwner() {
+    Component getDelegateFocusOwner() {
         return getTextComponent();
     }
 
     @Override
     public Dimension getPreferredSize() {

@@ -198,11 +198,11 @@
                 pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
                 break;
         }
     }
 
-    @SuppressWarnings("serial")
+    @SuppressWarnings("serial")// Safe: outer class is non-serializable.
     final class ScrollableJTextArea extends JScrollPane {
 
         ScrollableJTextArea() {
             super();
             getViewport().setView(new JTextAreaDelegate());

@@ -216,11 +216,10 @@
         public void setEnabled(final boolean enabled) {
             getViewport().getView().setEnabled(enabled);
             super.setEnabled(enabled);
         }
 
-        @SuppressWarnings("serial")
         private final class JTextAreaDelegate extends JTextArea {
 
             // Empty non private constructor was added because access to this
             // class shouldn't be emulated by a synthetic accessor method.
             JTextAreaDelegate() {