< prev index next >

src/java.desktop/windows/classes/sun/awt/windows/WListPeer.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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

@@ -37,14 +37,13 @@
     }
 
     // ListPeer implementation
 
     @Override
-    @SuppressWarnings("deprecation")
     public int[] getSelectedIndexes() {
         List l = (List)target;
-        int len = l.countItems();
+        int len = l.getItemCount();
         int sel[] = new int[len];
         int nsel = 0;
         for (int i = 0 ; i < len ; i++) {
             if (isSelected(i)) {
                 sel[nsel++] = i;

@@ -91,14 +90,13 @@
     }
     native void addItems(String[] items, int index, int width);
 
     @Override
     public native void delItems(int start, int end);
-    @SuppressWarnings("deprecation")
     public void clear() {
         List l = (List)target;
-        delItems(0, l.countItems());
+        delItems(0, l.getItemCount());
     }
     @Override
     public native void select(int index);
     @Override
     public native void deselect(int index);

@@ -129,11 +127,10 @@
 
     @Override
     native void create(WComponentPeer parent);
 
     @Override
-    @SuppressWarnings("deprecation")
     void initialize() {
         List li = (List)target;
 
         fm = getFontMetrics( li.getFont() );
 

@@ -142,11 +139,11 @@
         if (f != null) {
             setFont(f);
         }
 
         // add any items that were already inserted in the target.
-        int  nitems = li.countItems();
+        int  nitems = li.getItemCount();
         if (nitems > 0) {
             String[] items = new String[nitems];
             int maxWidth = 0;
             int width = 0;
             for (int i = 0; i < nitems; i++) {

@@ -158,11 +155,11 @@
             }
             addItems(items, 0, maxWidth);
         }
 
         // set whether this list should allow multiple selections.
-        setMultipleSelections(li.allowsMultipleSelections());
+        setMultipleSelections(li.isMultipleMode());
 
         // select the item if necessary.
         int sel[] = li.getSelectedIndexes();
         for (int i = 0 ; i < sel.length ; i++) {
             select(sel[i]);
< prev index next >