1 9 10 package org.netbeans.modules.web.jsf; 11 12 import java.awt.BorderLayout ; 13 import javax.swing.JComponent ; 14 import org.netbeans.modules.web.jsf.api.editor.JSFConfigEditorContext; 15 import org.openide.filesystems.FileObject; 16 import org.openide.loaders.DataObject; 17 import org.openide.nodes.Node; 18 import org.openide.util.Lookup; 19 import org.openide.windows.TopComponent; 20 21 25 public class JSFConfigEditorTopComponent extends TopComponent{ 26 27 private JComponent view; 28 29 public JSFConfigEditorTopComponent (JSFConfigEditorContext context, Lookup lookup, JComponent view) { 30 this.view = view; 31 setLayout (new BorderLayout ()); 32 setFocusable (true); 33 add (view, BorderLayout.CENTER); 34 try{ 36 Node node = DataObject.find(context.getFacesConfigFile()).getNodeDelegate(); 37 setActivatedNodes (new Node[] { node }); 38 } 39 catch (Exception e){} 40 } 43 44 public void requestFocus () { 45 super.requestFocus (); 46 view.requestFocus (); 47 } 48 49 public boolean requestFocusInWindow () { 50 super.requestFocusInWindow (); 51 return view.requestFocusInWindow (); 52 } 53 54 } 55 | Popular Tags |