1 19 20 package org.netbeans.modules.websvc.design.view; 21 22 import java.awt.BorderLayout ; 23 import javax.swing.Action ; 24 import javax.swing.JComponent ; 25 import javax.swing.JPanel ; 26 import javax.swing.JToolBar ; 27 import org.netbeans.api.visual.action.ActionFactory; 28 import org.netbeans.api.visual.widget.Scene; 29 import org.netbeans.api.visual.widget.Widget; 30 import org.netbeans.modules.websvc.api.jaxws.project.config.Service; 31 import org.netbeans.modules.websvc.design.view.actions.AddOperationAction; 32 import org.netbeans.modules.websvc.design.view.widget.OperationsWidget; 33 import org.openide.filesystems.FileObject; 34 35 40 public class DesignView extends JPanel { 41 42 private Scene scene; 43 46 public DesignView(Service service, FileObject implementationClass) { 47 super(new BorderLayout ()); 48 49 scene = new Scene(); 50 scene.getActions().addAction(ActionFactory.createZoomAction ()); 53 scene.getActions().addAction(ActionFactory.createPanAction ()); 54 scene.getActions().addAction(ActionFactory.createPopupMenuAction( 55 new DesignViewPopupProvider(new Action [] { 56 new AddOperationAction(service, implementationClass), 57 }))); 58 59 Widget opWidget = new OperationsWidget(scene,service); 61 scene.addChild(opWidget); 62 63 add(scene.createView()); 64 } 65 66 72 public void addToolbarActions(JToolBar toolbar) { 73 } 74 75 81 public JComponent getContent() { 82 return scene.getView(); 83 } 84 85 public void requestFocus() { 86 super.requestFocus(); 87 scene.getView().requestFocus(); 89 } 90 91 public boolean requestFocusInWindow() { 92 super.requestFocusInWindow(); 93 return scene.getView().requestFocusInWindow(); 95 } 96 97 } 98 | Popular Tags |