< prev index next >

src/com/sun/javatest/tool/UIFactory.java

Print this page

        

@@ -1256,11 +1256,11 @@
      * @param label Label to associate with this component
      * @return the choice component that was created
      * @see #createChoice(String)
      * @see javax.swing.JLabel#setLabelFor
      */
-    public JComboBox createChoice(String uiKey, JLabel label) {
+    public <E> JComboBox<E> createChoice(String uiKey, JLabel label) {
         return createChoice(uiKey, false, label);
     }
 
     /**
      * Combination of the two parameter methods, allowing you to select

@@ -1273,11 +1273,11 @@
      * @see #createChoice(String,JLabel)
      * @see #createChoice(String,boolean)
      * @see #createChoice(String)
      * @see javax.swing.JLabel#setLabelFor
      */
-    public JComboBox createChoice(String uiKey, boolean editable, JLabel label) {
+    public <E> JComboBox<E> createChoice(String uiKey, boolean editable, JLabel label) {
         JComboBox choice = new JComboBox();
         choice.setName(uiKey);
         setToolTip(choice, uiKey);
 
         if (label != null)

@@ -1317,12 +1317,12 @@
      * @param uiKey the base name of the resources to be used for the menu
      * @param choices the choices to appear in the choice item
      * @return the choice item that was created
      * @see #createChoice
      */
-    public JComboBox createLiteralChoice(String uiKey, Object[] choices) {
-        JComboBox choice = new JComboBox(choices);
+    public <E> JComboBox<E> createLiteralChoice(String uiKey, E[] choices) {
+        JComboBox<E> choice = new JComboBox<>(choices);
         choice.setName(uiKey);
         setToolTip(choice, uiKey);
         return choice;
     }
 

@@ -1456,12 +1456,12 @@
      * <tr><td><i>uiKey</i>.desc  <td>the accessible description of the list
      * </table>
      * @param uiKey the base name of the resource to be used (currently ignored)
      * @return the list that was created
      */
-    public JList createList(String uiKey) {
-        JList list = new JList();
+    public <E> JList<E> createList(String uiKey) {
+        JList<E> list = new JList<>();
         list.setName(uiKey);
         setAccessibleInfo(list, uiKey);
         return list;
     }
 

@@ -1476,12 +1476,12 @@
      * </table>
      * @param uiKey the base name of the resource to be used (currently ignored)
      * @param model the data model for this list
      * @return the list that was created
      */
-    public JList createList(String uiKey, ListModel model) {
-        JList list = new JList(model);
+    public <E> JList<E> createList(String uiKey, ListModel<E> model) {
+        JList<E> list = new JList<>(model);
         list.setName(uiKey);
         setAccessibleInfo(list, uiKey);
         return list;
     }
 
< prev index next >