Label label = toolkit.createLabel(body,
"This section describes general information about this project.");
label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 3, 1));
symbolicNameEntry = new SigilFormEntry(body, toolkit, "Symbolic Name");
symbolicNameEntry.setFormEntryListener(new SigilFormEntryAdapter()
{
@Override
public void textValueChanged(SigilFormEntry form)
{
symbolicName = nullIfEmpty((String) form.getValue());
checkDirty();
}
});
nameEntry = new SigilFormEntry(body, toolkit, "Name");
nameEntry.setFormEntryListener(new SigilFormEntryAdapter()
{
@Override
public void textValueChanged(SigilFormEntry form)
{
name = nullIfEmpty((String) form.getValue());
checkDirty();
}
});
descriptionEntry = new SigilFormEntry(body, toolkit, "Description");
descriptionEntry.setFormEntryListener(new SigilFormEntryAdapter()
{
@Override
public void textValueChanged(SigilFormEntry form)
{
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();
}
public Object getValue(String label)
{
return null;
}
};
fragmentHostEntry = new SigilFormEntry(body, toolkit, "Fragment Host",
"Browse...", converter);
fragmentHostEntry.setFormEntryListener(new SigilFormEntryAdapter()
{
@Override
public void textValueChanged(SigilFormEntry form)
{
fragmentHost = (IRequiredBundle) form.getValue();