Skip to content

Commit

Permalink
[#1317] LCO: replaceable EMF Forms
Browse files Browse the repository at this point in the history
properties are dynamic now
eparovyshnaya committed Mar 17, 2024
1 parent 227adef commit b87240c
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -54,7 +54,6 @@ public void notifyChanged(Notification notification) {
}
};
private FloatingLicensePack license;
private VViewModelProperties properties;
private Composite base;

IssueLicensePackPage(String name, Supplier<FloatingLicenseRequest> data, IEclipseContext context) {
@@ -83,12 +82,6 @@ public void createControl(Composite parent) {
base = new Composite(composite, SWT.NONE);
base.setLayout(new GridLayout(1, false));
base.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
properties = VViewFactory.eINSTANCE.createViewModelLoadingProperties();
properties.addNonInheritableProperty("viewpoint", "wizard"); //$NON-NLS-1$ //$NON-NLS-2$
properties.addInheritableProperty(EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_KEY,
EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_VALUE);
new WithMentor(license, context).inProperties(properties);

updatePage();
Dialog.applyDialogFont(composite);
}
@@ -126,13 +119,22 @@ private void renderEmfForms() {
}
try {
Arrays.asList(base.getChildren()).forEach(Control::dispose);
ECPSWTViewRenderer.INSTANCE.render(base, license, properties);
ECPSWTViewRenderer.INSTANCE.render(base, license, properties());
base.layout(); // guaranteed to exist and been not disposed
} catch (ECPRendererException e) {
// do nothing
}
}

private VViewModelProperties properties() {
VViewModelProperties properties = VViewFactory.eINSTANCE.createViewModelLoadingProperties();
properties.addNonInheritableProperty("viewpoint", "wizard"); //$NON-NLS-1$ //$NON-NLS-2$
properties.addInheritableProperty(EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_KEY,
EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_VALUE);
new WithMentor(license, context).inProperties(properties);
return properties;
}

protected boolean validatePage() {
Optional<String> errors = validate.apply(license);
setErrorMessage(errors.orElse(null));// framework requires null

0 comments on commit b87240c

Please sign in to comment.