finishAction() method.

Component Java
Build Wizards Quickly Using a Swing-Based Wizard Framework
Chang Sau Sheong
Listing 10. finishAction() method.


. . .

    public void finishAction() {
        super.finishAction(); // 1

        WizardData data = getData(); // 2
        Enumeration enum = data.keys();
        CodeGenerator gen = new CodeGenerator(); // 3

        String classname = (String)data.get("classname"); // 4
        gen.addValue("package",(String)data.get("packagename"));
        gen.addValue("classname", classname);
        gen.addValue("primarykey",(String)data.get("primarykey"));

        Vector variables = (Vector)data.get("variables");
        gen.addVariables(variables);

        gen.generate(classname,CodeGenerator.SPAFOBJECT); // 5

    }
. . .

About the Author

Chang Sau Sheong is vice president of product engineering at elipva Ltd. (formerly known as sstarfire.com). He can be contacted at [email protected].