Source:
private SelectionListener createButtonListener() { return new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { List<LayoutOption> layoutOptionOverrides = new ArrayList<>(); Map<String, CustomLayoutAlgorithm> layoutProviderRegistry = DiagramUIPlugin.getPlugin().getLayoutAlgorithms(); CustomLayoutConfiguration layout = (CustomLayoutConfiguration) eObject; CustomLayoutAlgorithm genericLayoutProviderSupplier = layoutProviderRegistry.get(layout.getId()); Map<String, LayoutOption> layoutOptions = genericLayoutProviderSupplier.getLayoutOptions(); for (LayoutOption layoutOption : layoutOptions.values()) { if (!layout.getLayoutOptions().stream().anyMatch(option -> option.getId().equals(layoutOption.getId()))) { LayoutOption copy = EcoreUtil.copy(layoutOption); if (copy instanceof EnumOption) { ((EnumOption) copy).getChoices().clear(); } copy.setDescription(""); layoutOptionOverrides.add(copy); } } OptionOverrideEditorDialog dialog = new OptionOverrideEditorDialog(composite.getShell(), (CustomLayoutConfiguration) eObject, Messages.AddOptionOverridePropertySection_dialogTitle, layoutOptionOverrides); dialog.open(); Set<LayoutOption> overrriddenOptions = dialog.getResult(); EditingDomain editingDomain = propertySheetPage.getEditor().getEditingDomain(); editingDomain.getCommandStack().execute(new AddCommand(editingDomain, layout, DescriptionPackage.eINSTANCE.getCustomLayoutConfiguration_LayoutOptions(), overrriddenOptions)); if (propertySheetPage.getCurrentTab() != null) { Display.getCurrent().asyncExec(() -> propertySheetPage.refresh()); } } }; }

Target:
private SelectionListener createButtonListener() { return new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { List<LayoutOption> layoutOptionOverrides = new ArrayList<>(); Map<String, CustomLayoutAlgorithm> layoutProviderRegistry = DiagramUIPlugin.getPlugin().getLayoutAlgorithms(); CustomLayoutConfiguration layout = (CustomLayoutConfiguration) eObject; CustomLayoutAlgorithm genericLayoutProviderSupplier = layoutProviderRegistry.get(layout.getId()); Map<String, LayoutOption> layoutOptions = genericLayoutProviderSupplier.getLayoutOptions(); for (LayoutOption layoutOption : layoutOptions.values()) { if (!layout.getLayoutOptions().stream().anyMatch(option -> option.getId().equals(layoutOption.getId()))) { LayoutOption copy = EcoreUtil.copy(layoutOption); if (copy instanceof EnumOption) { ((EnumOption) copy).getChoices().clear(); } copy.setDescription(""); layoutOptionOverrides.add(copy); } } OptionOverrideEditorDialog dialog = new OptionOverrideEditorDialog(composite.getShell(), (CustomLayoutConfiguration) eObject, Messages.AddOptionOverridePropertySection_dialogTitle, layoutOptionOverrides); dialog.open(); Set<LayoutOption> overrriddenOptions = dialog.getResult(); EditingDomain editingDomain = propertySheetPage.getEditor().getEditingDomain(); editingDomain.getCommandStack().execute(new AddCommand(editingDomain, layout, DescriptionPackage.eINSTANCE.getCustomLayoutConfiguration_LayoutOptions(), overrriddenOptions)); Display.getCurrent().asyncExec(() -> { if (propertySheetPage != null && propertySheetPage.getCurrentTab() != null) { propertySheetPage.refresh(); } }); } }; }