public void initializeFrom(ILaunchConfiguration configuration) {
    try {
      comp.getApplyTemplateCheck()
          .setSelection(configuration.getAttribute(IJ2SLauchingConfiguration.APPLY_TEMPLATE, true));
      comp.updateTemaplteCheck();

      comp.getTemplateCodeText()
          .setText(configuration.getAttribute(IJ2SLauchingConfiguration.VELOCITY_CODE, ""));
      comp.getOutputFileText()
          .setText(configuration.getAttribute(IJ2SLauchingConfiguration.OUTPUT_FILE_NAME, ""));
      comp.selectTemplateByName(
          configuration.getAttribute(IJ2SLauchingConfiguration.TEMPLATE_NAME, ""));

    } catch (CoreException e) {
      e.printStackTrace();
    }
  }
  public void performApply(ILaunchConfigurationWorkingCopy c) {

    //		if(templateCodeDirty ) {
    //			try {
    //				templateCodeDirty=false;
    //				comp.doSaveTemplateAs("Template code modified! \nIf you whish to save the changes, please
    // enter the name\nof new template.");
    //			} catch (Exception e) {
    //				e.printStackTrace();
    //			}
    //		}

    boolean applyTemplate = comp.getApplyTemplateCheck().getSelection();
    String templateCode = comp.getTemplateCodeText().getText();
    int selIdx = comp.getTemplateCombo().getSelectionIndex();
    String templateName = selIdx == -1 ? "" : comp.getTemplateCombo().getItems()[selIdx];
    String outputFileNameTemplate = comp.getOutputFileText().getText();

    c.setAttribute(IJ2SLauchingConfiguration.APPLY_TEMPLATE, applyTemplate);
    c.setAttribute(IJ2SLauchingConfiguration.VELOCITY_CODE, templateCode);
    c.setAttribute(IJ2SLauchingConfiguration.OUTPUT_FILE_NAME, outputFileNameTemplate);
    c.setAttribute(IJ2SLauchingConfiguration.TEMPLATE_NAME, templateName);
  }
 public void createControl(Composite parent) {
   try {
     comp = new J2sTemplateComposite(this, parent, SWT.NULL);
   } catch (Exception e) {
     MessageDialog.openError(
         parent.getShell(),
         "Error initializing templates",
         "An error occurs when trying to initialize templates : " + e.getMessage());
     e.printStackTrace();
     return;
   }
   GridData gd = new GridData(GridData.FILL_BOTH);
   comp.setLayoutData(gd);
   setControl(comp);
 }