Ejemplo n.º 1
0
 protected int showWizard(
     TaskModel taskModel, final IGeneratorConfiguration generatorConfiguration) {
   String title = null;
   WizardFragment fragment = null;
   taskModel.putObject(TaskModel.TASK_JM2T_PROJECT, JM2TCore.create(getProject()));
   if (generatorConfiguration == null) {
     // Add New generator configuration
     title = Messages.wizNewGeneratorConfigurationWizardTitle;
     fragment =
         new WizardFragment() {
           protected void createChildFragments(List<WizardFragment> list) {
             list.add(new SelectGeneratorTypeWizardFragment());
             list.add(new SelectModelConverterTypeWizardFragment());
             list.add(WizardTaskUtil.SaveRuntimeFragment);
           }
         };
   } else {
     // Edit selected generator configuration
     title = Messages.wizEditGeneratorConfigurationWizardTitle;
     final WizardFragment fragment2 =
         getEditGeneratorConfigurationWizardFragment(generatorConfiguration);
     taskModel.putObject(TaskModel.TASK_GENERATOR_CONFIGURATION, generatorConfiguration);
     fragment =
         new WizardFragment() {
           protected void createChildFragments(List<WizardFragment> list) {
             list.add(fragment2);
             list.add(WizardTaskUtil.SaveRuntimeFragment);
           }
         };
   }
   TaskWizard wizard = new TaskWizard(title, fragment, taskModel);
   wizard.setForcePreviousAndNextButtons(true);
   WizardDialog dialog = new WizardDialog(getShell(), wizard);
   return dialog.open();
 }
Ejemplo n.º 2
0
 @Override
 public boolean performOk() {
   // Save JM2T settings.
   IJM2TProject project = JM2TCore.create(getProject());
   try {
     project.setRawGeneratorConfiguration(generatorConfigurationComp.getElements(), null);
   } catch (CoreException e) {
     EclipseUtil.openError(super.getShell(), Messages.savingSettingsError, JM2TUI.createStatus(e));
   }
   return true;
 }
Ejemplo n.º 3
0
 private IJM2TProject getJM2Project() {
   return JM2TCore.create(getProject());
 }