use of org.bndtools.api.ProjectPaths in project bndtools by bndtools.
the class NewBndProjectWizardPageOne method getSourceClasspathEntries.
@Override
public IClasspathEntry[] getSourceClasspathEntries() {
IPath projectPath = new Path(getProjectName()).makeAbsolute();
ProjectPaths projectPaths = ProjectPaths.DEFAULT;
List<IClasspathEntry> newEntries = new ArrayList<IClasspathEntry>(2);
newEntries.add(JavaCore.newSourceEntry(projectPath.append(projectPaths.getSrc()), null, projectPath.append(projectPaths.getBin())));
boolean enableTestSrcDir;
try {
if (template == null)
enableTestSrcDir = true;
else {
ObjectClassDefinition templateMeta = template.getMetadata();
enableTestSrcDir = findAttribute(templateMeta, ProjectTemplateParam.TEST_SRC_DIR.getString()) != null;
}
} catch (Exception e) {
Plugin.getDefault().getLog().log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error accessing template parameters", e));
enableTestSrcDir = true;
}
if (enableTestSrcDir)
newEntries.add(JavaCore.newSourceEntry(projectPath.append(projectPaths.getTestSrc()), null, projectPath.append(projectPaths.getTestBin())));
return newEntries.toArray(new IClasspathEntry[0]);
}
use of org.bndtools.api.ProjectPaths in project bndtools by bndtools.
the class ProjectLayoutGroup method createControl.
public Control createControl(Composite parent) {
Group group = new Group(parent, SWT.NONE);
group.setText(groupTitle);
group.setLayout(new GridLayout(Math.max(4, ProjectLayout.values().length), true));
SelectionListener radioListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
for (Button button : layoutChoices) {
if (button.getSelection()) {
assert (button.getData() instanceof ProjectLayout);
chosenProjectLayout = (ProjectLayout) button.getData();
return;
}
}
}
};
for (ProjectLayout projectLayout : ProjectLayout.values()) {
ProjectPaths projectPaths = ProjectPaths.DEFAULT;
final Button radioButton = new Button(group, SWT.RADIO);
radioButton.setText(projectPaths.getTitle());
radioButton.setData(projectLayout);
radioButton.setSelection(this.chosenProjectLayout == projectLayout);
radioButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
radioButton.setToolTipText(projectPaths.getToolTip());
radioButton.addSelectionListener(radioListener);
layoutChoices.add(radioButton);
}
return group;
}
Aggregations