KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > jsf > JSFConfigEditorViewFactorySupport


1 /*
2  * JSFConfigEditorViewFactorySupport.java
3  *
4  * Created on February 7, 2007, 5:16 PM
5  *
6  * To change this template, choose Tools | Template Manager
7  * and open the template in the editor.
8  */

9
10 package org.netbeans.modules.web.jsf;
11
12 import java.util.ArrayList JavaDoc;
13 import java.util.Collection JavaDoc;
14 import java.util.Collections JavaDoc;
15 import org.netbeans.core.spi.multiview.MultiViewDescription;
16 import org.netbeans.modules.web.jsf.api.editor.JSFConfigEditorContext;
17 import org.netbeans.modules.web.jsf.api.editor.JSFConfigEditorViewFactory;
18 import org.openide.filesystems.FileObject;
19 import org.openide.util.Lookup;
20
21 /**
22  *
23  * @author petr
24  */

25 public class JSFConfigEditorViewFactorySupport {
26     
27     private static final Lookup.Result factoriesLookupResult = Lookup.getDefault ().lookupResult (JSFConfigEditorViewFactory.class);
28
29     public static Collection JavaDoc<MultiViewDescription> createViewDescriptions (JSFConfigEditorContext facesContext) {
30         ArrayList JavaDoc<MultiViewDescription> list = new ArrayList JavaDoc<MultiViewDescription> ();
31         for (Object JavaDoc factory : factoriesLookupResult.allInstances ()) {
32             MultiViewDescription desc = ((JSFConfigEditorViewFactory) factory).createMultiViewDescriptor (facesContext);
33             if (desc != null)
34                 list.add (desc);
35         }
36         return Collections.unmodifiableCollection (list);
37     }
38     
39 }
40
Popular Tags