1 19 20 package org.netbeans.modules.xml.wsdl.ui.view.treeeditor.newtype; 21 22 import java.io.IOException ; 23 import org.netbeans.modules.xml.wsdl.model.Documentation; 24 import org.netbeans.modules.xml.wsdl.model.WSDLComponent; 25 import org.netbeans.modules.xml.wsdl.model.WSDLModel; 26 import org.netbeans.modules.xml.wsdl.ui.actions.ActionHelper; 27 import org.openide.util.NbBundle; 28 import org.openide.util.datatransfer.NewType; 29 30 public class DocumentationNewType extends NewType { 31 private WSDLComponent mDef = null; 32 33 public DocumentationNewType(WSDLComponent def) { 34 mDef = def; 35 } 36 37 38 @Override 39 public String getName() { 40 return NbBundle.getMessage(DocumentationNewType.class, "LBL_NewType_Documentation"); 41 } 42 43 44 @Override 45 public void create() throws IOException { 46 WSDLModel model = mDef.getModel(); 47 model.startTransaction(); 48 Documentation doc = model.getFactory().createDocumentation(); 49 mDef.setDocumentation(doc); 50 model.endTransaction(); 51 ActionHelper.selectNode(doc); 52 } 53 } 54 | Popular Tags |