[Schmitzm-commits] r2206 - in trunk/schmitzm-core/src/main/java: de/schmitzm/swing javax/swing

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Jan 31 13:43:27 CET 2013


Author: mojays
Date: 2013-01-31 13:43:26 +0100 (Thu, 31 Jan 2013)
New Revision: 2206

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/ListMaintainancePanel.java
   trunk/schmitzm-core/src/main/java/javax/swing/ReferencedListModel.java
Log:
Downward compatibility to Java 1.6

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/ListMaintainancePanel.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/ListMaintainancePanel.java	2013-01-31 12:27:01 UTC (rev 2205)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/ListMaintainancePanel.java	2013-01-31 12:43:26 UTC (rev 2206)
@@ -28,7 +28,8 @@
  * @author Martin O.J. Schmitz
  */
 public abstract class ListMaintainancePanel<T> extends JPanel implements ActionListener, ListSelectionListener {
-  protected JList<T> list;
+//  protected JList<T> list; // TODO: Java 1.7
+  protected JList list;
 
   protected Action addAction;
   protected Action removeAction;
@@ -242,8 +243,9 @@
       performEditAction();
     }
     if ( "REMOVE".equals(actionID) ) {
-      for ( T elem : list.getSelectedValuesList() )
-        removeElement(elem);
+//      for ( T elem : list.getSelectedValuesList() ) // TODO: Java 1.7
+      for ( Object elem : list.getSelectedValuesList() )
+        removeElement((T)elem);
     }
     if ( "MOVE_UP".equals(actionID) ) {
       List<T> selectedValues = list.getSelectedValuesList();
@@ -277,7 +279,8 @@
   protected void performEditAction() {
     if ( editAction == null )
       return;
-    T elem = list.getSelectedValue();
+//    T elem = list.getSelectedValue(); // TODO: Java 1.7
+    T elem = (T)list.getSelectedValue();
     if ( elem == null )
       return;
     // Edit action:

Modified: trunk/schmitzm-core/src/main/java/javax/swing/ReferencedListModel.java
===================================================================
--- trunk/schmitzm-core/src/main/java/javax/swing/ReferencedListModel.java	2013-01-31 12:27:01 UTC (rev 2205)
+++ trunk/schmitzm-core/src/main/java/javax/swing/ReferencedListModel.java	2013-01-31 12:43:26 UTC (rev 2206)
@@ -44,7 +44,8 @@
  * @author Martin O.J. Schmitz
  *
  */
-public class ReferencedListModel<E> extends AbstractListModel<E>
+//public class ReferencedListModel<E> extends AbstractListModel<E> TODO: Java 1.7
+public class ReferencedListModel<E> extends AbstractListModel 
 {
     /** Hold the list data. */
     protected List<E> delegate;



More information about the Schmitzm-commits mailing list