Package org.openbp.swing.components.wizard

Examples of org.openbp.swing.components.wizard.WizardPage


      int n = valueParams.size();
      for (int i = n - 1; i >= 0; --i)
      {
        NodeParam param = (NodeParam) valueParams.get(i);

        WizardPage page = null;
        String type = param.getParamValueWizard();

        // Create the page according to the wizard type specified by the parameter
        if (type.equals("string"))
        {
View Full Code Here


          for (int i = 0; i < n; ++i)
          {
            GeneratorPageDescriptor pd = (GeneratorPageDescriptor) customPages.get(i);
            String pageName = pd.getName();

            WizardPage page = (WizardPage) getPage(pageName);

            if (page == null)
            {
              // If the page does not yet exist, create it
              String pageClassName = pd.getPageClassName();
              String objectClassName = pd.getObjectClassName();

              if (objectClassName != null)
              {
                // Object page, get/create the object
                Object o = context.getProperty(pageName);
                if (o == null)
                {
                  o = ReflectUtil.instantiate(objectClassName, null,
                    "generator settings object class");
                  context.setProperty(pageName, o);
                }

                // Create property browser page and set the object
                page = new WizardObjectPage(this, pd);
              }
              else if (pageClassName != null)
              {
                try
                {
                  Class pageClass = Class.forName(pageClassName);

                  // We retrieve the Constructor of the page that uses one single parameter
                  // of the type Wizard.

                  Constructor[] ctrs = pageClass.getDeclaredConstructors();
                  for (int ic = 0; ic < ctrs.length; ++ic)
                  {
                    Class[] params = ctrs[ic].getParameterTypes();
                    if (params.length == 1 && params[0] == GeneratorWizard.class)
                    {
                      page = (WizardPage) ctrs[ic].newInstance(new Object[]
                      {
                        this
                      });
                      break;
                    }
                  }

                  if (page == null)
                    throw new GeneratorException("Class '" + pageClassName
                      + "' does not have a (GeneratorWizard) constructor.");
                }
                catch (Exception e)
                {
                  String msg = LogUtil.error(getClass(), "Cannot instantiate page class $0.",
                    pageClassName, e);
                  String exMsg = ExceptionUtil.getNestedMessage(e);
                  throw new GeneratorException(exMsg != null ? exMsg : msg);
                }
              }

              if (page != null)
              {
                // Get the description of the page from the page descriptor
                String pageDescription = pd.getDescription();
                page.setDescription(pageDescription);

                // Add it to the wizard
                addPage(pageName, page);
              }
            }

            if (page != null)
            {
              // Get the title of the page from the page descriptor
              String pageTitle = pd.getDisplayName();
              if (pageTitle == null)
                pageTitle = generator.getDisplayName();
              page.setTitle(pageTitle);

              if (pd.isFinish())
              {
                page.canFinish = true;
              }
View Full Code Here

TOP

Related Classes of org.openbp.swing.components.wizard.WizardPage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.