1 7 8 package com.memoire.vainstall.builder.action; 9 10 import com.memoire.vainstall.VAGlobals; 11 import com.memoire.vainstall.builder.*; 12 import com.memoire.vainstall.builder.gui.*; 13 import com.memoire.vainstall.builder.util.*; 14 15 import java.io.File ; 16 17 import javax.swing.JOptionPane ; 18 19 32 public class NewProductAction extends AbstractVAIBuilderAction { 33 34 37 public NewProductAction() { 38 super(); 39 } 40 41 44 public void runnit() { 45 46 NewProductWizard newProductWizard = new NewProductWizard(getController().getFrame()); 48 newProductWizard.initialize(getModel()); 49 newProductWizard.setVisible(true); 50 51 String result = newProductWizard.getAction(); 53 54 if(result.equals(VAGlobals.getResource("com.memoire.vainstall.builder.Language","Common_Cancel")) == true) { 56 return; 57 } 58 59 String projectName = newProductWizard.getProductName(); 61 String projectVersion = newProductWizard.getProductVersion(); 62 String projectDirectory = newProductWizard.getProductDirectory() 63 + File.separator 64 + projectName 65 + "_" 66 + projectVersion; 67 String productType = newProductWizard.getProductType(); 68 69 VAIProductController productController = new VAIProductController(); 70 try { 71 productController.createProject(projectName, projectVersion, projectDirectory, productType); 72 } catch (VAIBuilderException exc) { 73 JOptionPane.showMessageDialog(getController().getFrame(), 74 exc.getMessageAsHtml(), 75 VAGlobals.NAME, 76 JOptionPane.ERROR_MESSAGE); 77 return; 78 } 79 getController().addProduct(projectDirectory,productController); 80 81 } 82 83 } 84 | Popular Tags |