description = nullIfEmpty((String) form.getValue());
checkDirty();
}
});
IFormValueConverter converter = new IFormValueConverter()
{
public String getLabel(Object value)
{
Version v = (Version) value;
return v.toString();
}
public Object getValue(String label)
{
return VersionTable.getVersion(label);
}
};
versionEntry = new SigilFormEntry(body, toolkit, "Version", null, converter);
versionEntry.setFormEntryListener(new SigilFormEntryAdapter()
{
@Override
public void textValueChanged(SigilFormEntry form)
{
version = (Version) form.getValue();
checkDirty();
}
});
providerEntry = new SigilFormEntry(body, toolkit, "Provider");
providerEntry.setFormEntryListener(new SigilFormEntryAdapter()
{
@Override
public void textValueChanged(SigilFormEntry form)
{
provider = nullIfEmpty((String) form.getValue());
checkDirty();
}
});
activatorEntry = new SigilFormEntry(body, toolkit, "Bundle Activator",
"Browse...", null);
activatorEntry.setFormEntryListener(new SigilFormEntryAdapter()
{
@Override
public void textValueChanged(SigilFormEntry form)
{
activator = (String) form.getValue();
checkDirty();
}
@Override
public void browseButtonSelected(SigilFormEntry form)
{
BackgroundLoadingSelectionDialog<String> dialog = ResourcesDialogHelper.createClassSelectDialog(
getShell(), "Add Bundle Activator", getProjectModel(), activator,
BundleActivator.class.getName());
if (dialog.open() == Window.OK)
{
form.setValue(dialog.getSelectedElement());
}
}
});
converter = new IFormValueConverter()
{
public String getLabel(Object value)
{
IRequiredBundle b = (IRequiredBundle) value;
return b == null ? null : b.getSymbolicName() + " " + b.getVersions();