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