section.setText(UIPlugin.getLocalString("_UI_GeneralInformation_title")); //$NON-NLS-1$
section.setDescription(UIPlugin.getLocalString("_UI_GeneralInformation_description")); //$NON-NLS-1$
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(section);
GridDataFactory textGDFactory = GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).indent(
4, 0);
Composite client = toolkit.createComposite(section);
client.setLayout(new GridLayout(4, false));
toolkit.createLabel(client, UIPlugin.getLocalString("_UI_Name_label")); //$NON-NLS-1$
userText = toolkit.createText(client, null);
userText.addVerifyListener(ownerCharsVerifier);
userText.addModifyListener(nameAndUserListener);
textGDFactory.applyTo(userText);
toolkit.createLabel(client, "-"); //$NON-NLS-1$
nameText = toolkit.createText(client, null);
nameText.addVerifyListener(nameCharsVerifier);
nameText.addModifyListener(nameAndUserListener);
textGDFactory.applyTo(nameText);
toolkit.createLabel(client, UIPlugin.getLocalString("_UI_Version_label")); //$NON-NLS-1$
versionText = toolkit.createText(client, null);
versionText.addVerifyListener(versionCharsVerifier);
versionText.addModifyListener(new GuardedModifyListener() {
@Override
public void handleEvent(ModifyEvent e) {
String version = versionText.getText();
validateVersion(version, versionText);
getModel().setVersion(version);
}
});
// Rest is on a line of their own so they need to span 3 columns
textGDFactory = textGDFactory.span(3, 1);
textGDFactory.applyTo(versionText);
toolkit.createLabel(client, UIPlugin.getLocalString("_UI_Author_label")); //$NON-NLS-1$
authorText = toolkit.createText(client, null);
authorText.addVerifyListener(defaultVerifier);
authorText.addModifyListener(new GuardedModifyListener() {
@Override
public void handleEvent(ModifyEvent e) {
getModel().setAuthor(authorText.getText());
}
});
textGDFactory.applyTo(authorText);
toolkit.createLabel(client, UIPlugin.getLocalString("_UI_License_label")); //$NON-NLS-1$
licenseText = toolkit.createText(client, null);
licenseText.addVerifyListener(defaultVerifier);
licenseText.addModifyListener(new GuardedModifyListener() {
@Override
public void handleEvent(ModifyEvent e) {
getModel().setLicense(licenseText.getText());
}
});
textGDFactory.applyTo(licenseText);
toolkit.paintBordersFor(client);
section.setClient(client);
}