예제 #1
0
 private void moveForward() {
   if (currentWizardPane.validateValues()) {
     this.currentPage++;
     moveToPage(this.currentPage);
   } else {
     showErrorMessage();
   }
 }
예제 #2
0
  public WizardFrame() {
    List<Class<?>> agentClasses =
        RSApplication.getRSApplicationInstance()
            .getCurrentScenario()
            .getContext()
            .getAgentClasses(true);

    for (Class a : agentClasses) {
      if (AggregatorAgent.class.isAssignableFrom(a) && !Modifier.isAbstract(a.getModifiers())) {
        WizardFrame.aggregatorClasses.add(a);
      } else if (ProsumerAgent.class.isAssignableFrom(a)
          && !Modifier.isAbstract(a.getModifiers())) {
        WizardFrame.prosumerClasses.add(a);
      }
    }

    DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder;
    try {
      docBuilder = docFactory.newDocumentBuilder();
      this.config = docBuilder.newDocument();
      Element rootElement = this.config.createElement("context");
      this.config.appendChild(rootElement);
    } catch (ParserConfigurationException e) {
      System.err.println("Couldn't configure parser to produce an XML document");
      e.printStackTrace();
    }

    this.setTitle("Cascade Context configuration wizard");
    this.setSize(WizardFrame.WIZARD_WINDOW_DEFAULT_WIDTH, WizardFrame.WIZARD_WINDOW_DEFAULT_HEIGHT);
    this.setLocationRelativeTo(null);
    this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    WizardPane contentPanel =
        new WizardPane(
            this.config,
            WizardFrame.WIZARD_WINDOW_DEFAULT_WIDTH,
            WizardFrame.WIZARD_WINDOW_DEFAULT_HEIGHT);
    this.getContentPane().add(contentPanel);
    JList list = new JList();
    list.setBounds(135, 107, 1, 1);
    contentPanel.add(list);
    this.setVisible(true);
  }
예제 #3
0
 private void processFinish() {
   if (currentWizardPane.validateValues()) {
     try {
       new Controller().process(wizardBean);
       showSuccessMessage(" jar file creation successful! ");
     } catch (ProcessException e) {
       showErrorMessage(e.getMessage());
     } catch (Exception e) {
       showErrorMessage("Unknown Error! " + e.getMessage());
     }
   } else {
     showErrorMessage();
   }
 }
예제 #4
0
 public WizardDialog(WizardPageProvider<WC> aPageProvider, WC aContext) {
   mController = new WizardController<WC>(aPageProvider, aContext);
   mPane = new WizardPane(mController, aPageProvider);
   setModal(true);
   setContentPane(mPane.getVisual());
 }