/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2009 INRIA/University of Nice-Sophia Antipolis
 * Contact: proactive@ow2.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://proactive.inria.fr/team_members.htm
 *  Contributor(s): ActiveEon Team - http://www.activeeon.com
 *
 * ################################################################
 * $$ACTIVEEON_CONTRIBUTOR$$
 */
package org.ow2.proactive.resourcemanager.gui.table;

import java.util.Arrays;
import java.util.List;

import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.ow2.proactive.resourcemanager.gui.data.RMStore;
import org.ow2.proactive.resourcemanager.gui.data.model.Node;
import org.ow2.proactive.resourcemanager.gui.handlers.RemoveNodesHandler;


public class TableSelectionListener implements ISelectionChangedListener {

    public void selectionChanged(SelectionChangedEvent event) {
        final IStructuredSelection selection = (IStructuredSelection) event.getSelectionProvider()
                .getSelection();
        // Converting an array to a generic list using Array.asList
        final Node[] arr = (Node[]) selection.toArray();
        final List<Node> list = Arrays.asList(arr);
        // normally RM is connected if I can select something...
        if (RMStore.isConnected()) {
            RemoveNodesHandler.getInstance().setSelectedNodes(list);
        }
    }

}

@@ -1367,17 +1367,20 @@
 il.Array
-s
+List
 ;%0Aimport
@@ -1923,41 +1923,24 @@
 nal 
-IStructuredSelection selection
+Object%5B%5D arr
  = 
+(
 (ISt
@@ -1990,219 +1990,231 @@
 er()
-%0A                .getSelection();%0A        // Converting an array to a generic
+.getSelection()).toArray();%0A        if (arr.length != 0) %7B%0A            final List%3CNode%3E
  list 
-using
+= new
  Array
-.as
 List
-%0A        final Node%5B%5D arr = (Node%5B%5D) selection.toArray();%0A        final List%3CNode%3E list = Arrays.asList(arr);%0A
+%3CNode%3E(arr.length);%0A            for (final Object o : arr) %7B%0A                list.add((Node) o);%0A            %7D%0A    
     
@@ -2274,16 +2274,20 @@
 hing...%0A
+    
         
@@ -2327,16 +2327,20 @@
         
+    
 RemoveNo
@@ -2388,16 +2388,30 @@
 (list);%0A
+            %7D%0A
         
@@ -2416,13 +2416,12 @@
   %7D%0A
+
     %7D%0A
-%0A
 %7D%0A

Fix typo