Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator: allow to edit feature grants for on license issuing #1173 #1174

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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