Example #1
0
  // @Override
  public boolean performFinish() {
    IWorkspaceRunnable op =
        new IWorkspaceRunnable() {
          public void run(IProgressMonitor monitor)
              throws CoreException, OperationCanceledException {
            try {
              finishPage(monitor);
            } catch (InterruptedException e) {
              throw new OperationCanceledException(e.getMessage());
            }
          }
        };

    try {
      getContainer().run(false, true, new WorkbenchRunnableAdapter(op));
    } catch (InvocationTargetException e) {
      handleFinishException(getShell(), e);
      return false;
    } catch (InterruptedException e) {
      return false;
    }
    return true && flowWizardPage1.finish();

    // return ;
  }
Example #2
0
  /**
   * Obtains the user input from the wizard pages, creates a <code>Config</code> object that
   * contains all this information, and delegates the source code generation to a <code>JETGateway
   * </code> object. Finally, the generated Java source code file is opened in an editor.
   */
  protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
    // Config config = new Config();
    Config config = Config.getInstance();
    config.setModel(flowWizardPage1.getCodegenVariables());
    config.setPackageName("com.netapp.nmsdk.flow");
    config.setTargetFile("NetAppFlowMain" + ".java");
    config.setTargetFolder(flowWizardPage1.getContainerFullPath().toPortableString());

    config.setClasspathVariable("NETAPP_PATH");

    config.setPluginId(FlowPlugin.getPluginId());
    config.setTemplateRelativeUri("NetAppFlowMain.javajet");

    JETMain gateway = new JETMain(config);
    String content = gateway.generate(monitor);
    IFile file = gateway.save(monitor, content.getBytes());

    selectAndReveal(file);
    openResource(file);
  }