예제 #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();
 }
예제 #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;
 }
예제 #3
0
 private IJM2TProject getJM2Project() {
   return JM2TCore.create(getProject());
 }