final DataDescriptor projectName = new StringDataDescriptor(CoreMessages.getString("ProbeMakerPlugIn.NAME_PROJECT_NAME"),CoreMessages.getString("ProbeMakerPlugIn.TOOLTIP_PROJECT_NAME"),"PROJECT_NAME",true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
final DataDescriptor useTemplate = new BooleanDescriptor(CoreMessages.getString("ProbeMakerPlugIn.NAME_USE_TEMPLATE"),useToolTip,"USE_TEMPLATE"); //$NON-NLS-1$ //$NON-NLS-2$
final DataDescriptor templateSel = new TemplateListSelectionDescriptor(null,null,"TEMPLATE",templateManager.getTemplateArray(),false); //$NON-NLS-1$
final DataHolder newProjectData = new DefaultDataHolder(new DataDescriptor[] {
projectName,
useTemplate,
templateSel
});
if (!platform.getUI().inputData(newProjectData,CoreMessages.getString("NewProjectDialog.TITLE_NEW_PROJECT"))) { //$NON-NLS-1$
return;
}
String name = (String) newProjectData.getData("PROJECT_NAME"); //$NON-NLS-1$
if (name == null) {
return;
}
if (name.length() == 0) {
name = CoreMessages.getString("ProbeMakerPlugIn.NAME_NEW_PROJECT"); //$NON-NLS-1$
}
final boolean use = ((Boolean) newProjectData.getData("USE_TEMPLATE")).booleanValue(); //$NON-NLS-1$
if (use) {
template = (ProjectTemplate) newProjectData.getData("TEMPLATE"); //$NON-NLS-1$
if (template == null) {
final byte result = platform.getUI().sendMessage(CoreMessages.getString("ProbeMakerPlugIn.MESSAGE_NO_TEMPLATE"),CoreMessages.getString("ProbeMakerPlugIn.TITLE_NEW_PROJECT"),PlatformUI.YES_NO_QUERY); //$NON-NLS-1$ //$NON-NLS-2$
if (result == PlatformUI.NO_OPTION) {
return;
}