1 5 package org.hibernate.eclipse.console.actions; 6 7 import java.util.Iterator ; 8 import java.util.List ; 9 10 import org.eclipse.jface.viewers.StructuredViewer; 11 import org.eclipse.ui.actions.SelectionListenerAction; 12 13 17 public class RefreshAction extends SelectionListenerAction { 18 19 private final StructuredViewer viewer; 20 21 public RefreshAction(StructuredViewer viewer) { 22 super("Refresh"); 23 this.viewer = viewer; 24 } 25 26 public void run() { 27 List selectedNonResources = getSelectedNonResources(); 28 29 Iterator iter = selectedNonResources.iterator(); 30 while (iter.hasNext()) { 31 Object element = iter.next(); 32 viewer.refresh(element); 33 } 34 35 36 } 37 38 } 39 | Popular Tags |