KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > eclipse > console > actions > RefreshAction


1 /*
2  * Created on 2004-10-29 by max
3  *
4  */

5 package org.hibernate.eclipse.console.actions;
6
7 import java.util.Iterator JavaDoc;
8 import java.util.List JavaDoc;
9
10 import org.eclipse.jface.viewers.StructuredViewer;
11 import org.eclipse.ui.actions.SelectionListenerAction;
12
13 /**
14  * @author max
15  *
16  */

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 JavaDoc selectedNonResources = getSelectedNonResources();
28         
29         Iterator JavaDoc iter = selectedNonResources.iterator();
30         while (iter.hasNext()) {
31             Object JavaDoc element = iter.next();
32             viewer.refresh(element);
33         }
34         
35         
36     }
37
38 }
39
Popular Tags