use of org.apache.maven.archetype.metadata.RequiredProperty in project sling by apache.
the class ArchetypeParametersWizardPage method initialize.
@SuppressWarnings("unchecked")
private void initialize() {
if (propertiesTable == null) {
return;
}
Archetype archetype = parent.getChooseArchetypePage().getSelectedArchetype();
if (archetype == null) {
return;
}
try {
ArchetypeManager archetypeManager = MavenPluginActivator.getDefault().getArchetypeManager();
ArtifactRepository remoteArchetypeRepository = archetypeManager.getArchetypeRepository(archetype);
properties = (List<RequiredProperty>) archetypeManager.getRequiredProperties(archetype, remoteArchetypeRepository, null);
Table table = propertiesViewer.getTable();
table.setItemCount(properties.size());
int i = 0;
for (Iterator<RequiredProperty> it = properties.iterator(); it.hasNext(); ) {
RequiredProperty rp = it.next();
TableItem item = table.getItem(i++);
if (!rp.getKey().equals(item.getText())) {
// then create it - otherwise, reuse it
item.setText(0, rp.getKey());
item.setText(1, "");
item.setData(item);
}
}
} catch (Exception e) {
throw new RuntimeException("Could not process archetype: " + e.getMessage(), e);
}
}
Aggregations