use of org.bndtools.core.ui.wizards.shared.TemplateParamsWizardPage in project bndtools by bndtools.
the class BndRunFileWizard method init.
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.workbench = workbench;
mainPage = new WizardNewFileCreationPage("newFilePage", selection) {
@Override
protected InputStream getInitialContents() {
try {
return getTemplateContents(getFileName());
} catch (Exception e) {
throw new WrappingException(e);
}
}
};
mainPage.setTitle("New Bnd Run Descriptor");
// $NON-NLS-1$
mainPage.setFileExtension("bndrun");
mainPage.setAllowExistingResources(false);
BuiltInTemplate baseTemplate = new BuiltInTemplate("\u00abEmpty\u00bb", DEFAULT_TEMPLATE_ENGINE);
baseTemplate.addInputResource("$fileName$", new StringResource(""));
baseTemplate.setHelpPath("docs/empty_run.xml");
templatePage = new TemplateSelectionWizardPage("runTemplateSelection", "bndrun", baseTemplate);
templatePage.setTitle("Select Run Descriptor Template");
paramsPage = new TemplateParamsWizardPage(PROPS);
templatePage.addPropertyChangeListener(TemplateSelectionWizardPage.PROP_TEMPLATE, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
paramsPage.setTemplate(templatePage.getTemplate());
}
});
}
use of org.bndtools.core.ui.wizards.shared.TemplateParamsWizardPage in project bndtools by bndtools.
the class NewBndProjectWizard method init.
@Override
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
super.init(workbench, currentSelection);
BuiltInTemplate baseTemplate = new BuiltInTemplate(EMPTY_TEMPLATE_NAME, DEFAULT_TEMPLATE_ENGINE);
// $NON-NLS-1$
baseTemplate.addInputResource(Project.BNDFILE, new StringResource(""));
// $NON-NLS-1$
baseTemplate.setHelpPath("docs/empty_project.xml");
templatePage = new ProjectTemplateSelectionWizardPage("projectTemplateSelection", "project", baseTemplate);
templatePage.setTitle("Select Project Template");
paramsPage = new TemplateParamsWizardPage(ProjectTemplateParam.valueStrings());
templatePage.addPropertyChangeListener(TemplateSelectionWizardPage.PROP_TEMPLATE, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
Template template = templatePage.getTemplate();
pageOne.setTemplate(template);
paramsPage.setTemplate(template);
}
});
setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(Plugin.getDefault().getBundle().getEntry("icons/bndtools-wizban.png")));
}
Aggregations