Skip to content

Commit

Permalink
Merge pull request #1174 from eclipse-passage/1173
Browse files Browse the repository at this point in the history
Operator: allow to edit feature grants for on license issuing #1173
  • Loading branch information
ruspl-afed committed Nov 29, 2022
2 parents c632a2e + 307c7a2 commit 3a5ecd4
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
Expand Up @@ -47,7 +47,6 @@ class IssueLicensePackPage extends TwoPhaseWizardPage {
private final Supplier<PersonalLicenseRequest> data;
private final ErrorMessages validate;
private PersonalLicensePack license;
private VViewModelProperties properties;
private Composite base;

protected IssueLicensePackPage(String name, Supplier<PersonalLicenseRequest> data, IEclipseContext context) {
Expand Down Expand Up @@ -109,9 +108,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.addInheritableProperty(EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_KEY,
EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_VALUE);
buildPage();
Dialog.applyDialogFont(composite);
}
Expand All @@ -129,14 +125,23 @@ private void buildPage() {
control.dispose();
}
try {
ECPSWTViewRenderer.INSTANCE.render(base, license, properties);
ECPSWTViewRenderer.INSTANCE.render(base, license, properties());
base.layout();
} catch (ECPRendererException e) {
e.printStackTrace();
}
}
setPageComplete(validatePage());
}

private VViewModelProperties properties() {
VViewModelProperties properties = VViewFactory.eINSTANCE.createViewModelLoadingProperties();
properties.addInheritableProperty(EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_KEY,
EMFFormsSWTConstants.USE_ON_MODIFY_DATABINDING_VALUE);
// properties.addNonInheritableProperty("viewpoint", "wizard");
return properties;
}

protected boolean validatePage() {
Optional<String> errors = validate.apply(license);
setErrorMessage(errors.orElse(null));// framework requires null
Expand Down
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<org.eclipse.emf.ecp.view.model:View xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:org.eclipse.emf.ecp.view.group.model="http://org/eclipse/emf/ecp/view/group/model" xmlns:org.eclipse.emf.ecp.view.horizontal.model="http://org/eclipse/emf/ecp/view/horizontal/model" xmlns:org.eclipse.emf.ecp.view.model="http://org/eclipse/emf/ecp/view/model/1180" xmi:id="__u4qcL-xEeuw7f5-0ea7hA" name="FeatureGrant" readonly="true">
<org.eclipse.emf.ecp.view.model:View xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:org.eclipse.emf.ecp.view.group.model="http://org/eclipse/emf/ecp/view/group/model" xmlns:org.eclipse.emf.ecp.view.horizontal.model="http://org/eclipse/emf/ecp/view/horizontal/model" xmlns:org.eclipse.emf.ecp.view.model="http://org/eclipse/emf/ecp/view/model/1180" xmi:id="__u4qcL-xEeuw7f5-0ea7hA" name="FeatureGrant">
<rootEClass href="http://www.eclipse.org/passage/lic/licenses/2.0.0#//FeatureGrant"/>
<children xsi:type="org.eclipse.emf.ecp.view.group.model:Group" xmi:id="_QYRzYMEXEeuw7f5-0ea7hA" name="General">
<children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="__u874L-xEeuw7f5-0ea7hA" name="Control identifier">
Expand Down
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<org.eclipse.emf.ecp.view.model:View xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:org.eclipse.emf.ecp.view.group.model="http://org/eclipse/emf/ecp/view/group/model" xmlns:org.eclipse.emf.ecp.view.horizontal.model="http://org/eclipse/emf/ecp/view/horizontal/model" xmlns:org.eclipse.emf.ecp.view.model="http://org/eclipse/emf/ecp/view/model/1180" xmi:id="_Aa4foMB0Eeuw7f5-0ea7hA" name="PersonalFeatureGrant" readonly="true">
<org.eclipse.emf.ecp.view.model:View xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:org.eclipse.emf.ecp.view.group.model="http://org/eclipse/emf/ecp/view/group/model" xmlns:org.eclipse.emf.ecp.view.horizontal.model="http://org/eclipse/emf/ecp/view/horizontal/model" xmlns:org.eclipse.emf.ecp.view.model="http://org/eclipse/emf/ecp/view/model/1180" xmi:id="_Aa4foMB0Eeuw7f5-0ea7hA" name="PersonalFeatureGrant">
<rootEClass href="http://www.eclipse.org/passage/lic/licenses/2.0.0#//PersonalFeatureGrant"/>
<children xsi:type="org.eclipse.emf.ecp.view.group.model:Group" xmi:id="_WECuQMEVEeuw7f5-0ea7hA" name="General">
<children xsi:type="org.eclipse.emf.ecp.view.horizontal.model:HorizontalLayout" xmi:id="_YKy_YMEVEeuw7f5-0ea7hA">
<children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_Aa9YIMB0Eeuw7f5-0ea7hA" name="Control identifier">
<children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_Aa9YIMB0Eeuw7f5-0ea7hA" name="Control identifier" readonly="true">
<domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_Aa9YIcB0Eeuw7f5-0ea7hA">
<domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.eclipse.org/passage/lic/licenses/2.0.0#//PersonalFeatureGrant/identifier"/>
</domainModelReference>
Expand All @@ -16,14 +16,14 @@
</children>
</children>
<children xsi:type="org.eclipse.emf.ecp.view.group.model:Group" xmi:id="_aIv50MEVEeuw7f5-0ea7hA" name="Feature">
<children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_zKrtQMEVEeuw7f5-0ea7hA" name="FeatureRef identifier">
<children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_zKrtQMEVEeuw7f5-0ea7hA" name="FeatureRef identifier" readonly="true">
<domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_104CoMEVEeuw7f5-0ea7hA">
<domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.eclipse.org/passage/lic/licenses/2.0.0#//FeatureRef/identifier"/>
<domainModelEReferencePath href="http://www.eclipse.org/passage/lic/licenses/2.0.0#//PersonalFeatureGrant/feature"/>
</domainModelReference>
</children>
<children xsi:type="org.eclipse.emf.ecp.view.horizontal.model:HorizontalLayout" xmi:id="_RezzEMEWEeuw7f5-0ea7hA">
<children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_IS9ukMEWEeuw7f5-0ea7hA" name="VersionMatch version">
<children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_IS9ukMEWEeuw7f5-0ea7hA" name="VersionMatch version" readonly="true">
<domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_K1G7MMEWEeuw7f5-0ea7hA">
<domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.eclipse.org/passage/lic/licenses/2.0.0#//VersionMatch/version"/>
<domainModelEReferencePath href="http://www.eclipse.org/passage/lic/licenses/2.0.0#//PersonalFeatureGrant/feature"/>
Expand Down
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<org.eclipse.emf.ecp.view.model:View xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:org.eclipse.emf.ecp.view.group.model="http://org/eclipse/emf/ecp/view/group/model" xmlns:org.eclipse.emf.ecp.view.horizontal.model="http://org/eclipse/emf/ecp/view/horizontal/model" xmlns:org.eclipse.emf.ecp.view.model="http://org/eclipse/emf/ecp/view/model/1180" xmi:id="_h7uaUL_KEeuw7f5-0ea7hA" name="PersonalLicensePack" readonly="true">
<org.eclipse.emf.ecp.view.model:View xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:org.eclipse.emf.ecp.view.group.model="http://org/eclipse/emf/ecp/view/group/model" xmlns:org.eclipse.emf.ecp.view.horizontal.model="http://org/eclipse/emf/ecp/view/horizontal/model" xmlns:org.eclipse.emf.ecp.view.model="http://org/eclipse/emf/ecp/view/model/1180" xmi:id="_h7uaUL_KEeuw7f5-0ea7hA" name="PersonalLicensePack">
<rootEClass href="http://www.eclipse.org/passage/lic/licenses/2.0.0#//PersonalLicensePack"/>
<children xsi:type="org.eclipse.emf.ecp.view.group.model:Group" xmi:id="_K-c2wMBNEeuw7f5-0ea7hA" name="General">
<children xsi:type="org.eclipse.emf.ecp.view.horizontal.model:HorizontalLayout" xmi:id="_gPNeoMBNEeuw7f5-0ea7hA">
Expand Down
Expand Up @@ -6,7 +6,7 @@
<domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.eclipse.org/passage/lic/licenses/2.0.0#//VersionMatch/version"/>
</domainModelReference>
</children>
<children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_4Ra10hrKEeuMV_ofZRuPaw" name="Control rule" readonly="true">
<children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_4Ra10hrKEeuMV_ofZRuPaw" name="Control rule">
<domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_4Ra10xrKEeuMV_ofZRuPaw">
<domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.eclipse.org/passage/lic/licenses/2.0.0#//VersionMatch/rule"/>
</domainModelReference>
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2021 ArSysOp
* Copyright (c) 2018, 2022 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -197,8 +197,10 @@ protected TreeMasterDetailComposite createTreeMasterDetail(final Composite compo
ChildrenDescriptorCollector childrenDescriptorCollector = createChildrenDescriptorCollector();
MenuProvider menuProvider = createMenuProvider(childrenDescriptorCollector, createElementCallback);
final TreeMasterDetailComposite treeMasterDetail = TreeMasterDetailSWTFactory
.fillDefaults(composite, SWT.NONE, editorInput).customizeCildCreation(createElementCallback)
.customizeMenu(menuProvider).create();
.fillDefaults(composite, SWT.NONE, editorInput) //
.customizeCildCreation(createElementCallback) //
.customizeMenu(menuProvider)//
.create();
return treeMasterDetail;
}

Expand Down

0 comments on commit 3a5ecd4

Please sign in to comment.