X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=security%2Fplugins%2Forg.argeo.security.ui.admin%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fsecurity%2Fui%2Fadmin%2Fcommands%2FAddRole.java;h=a036d12a34ded0c7dce300ca3102a1a5fad3851f;hb=5266ec50ddbf3247a5033d98a1dbceec6673a5b8;hp=047c167e07f34590e8f67c499de989276e712eea;hpb=183b34a3f8c0bce78bed916d413934f20522818c;p=lgpl%2Fargeo-commons.git diff --git a/security/plugins/org.argeo.security.ui.admin/src/main/java/org/argeo/security/ui/admin/commands/AddRole.java b/security/plugins/org.argeo.security.ui.admin/src/main/java/org/argeo/security/ui/admin/commands/AddRole.java index 047c167e0..a036d12a3 100644 --- a/security/plugins/org.argeo.security.ui.admin/src/main/java/org/argeo/security/ui/admin/commands/AddRole.java +++ b/security/plugins/org.argeo.security.ui.admin/src/main/java/org/argeo/security/ui/admin/commands/AddRole.java @@ -2,11 +2,15 @@ package org.argeo.security.ui.admin.commands; import org.argeo.ArgeoException; import org.argeo.security.UserAdminService; +import org.argeo.security.ui.admin.editors.ArgeoUserEditor; import org.argeo.security.ui.admin.views.RolesView; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.IEditorReference; +import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.handlers.HandlerUtil; +import org.eclipse.ui.internal.EditorReference; /** Add a new role. */ public class AddRole extends AbstractHandler { @@ -30,6 +34,17 @@ public class AddRole extends AbstractHandler { throw new ArgeoException("Role " + role + " already exists"); userAdminService.newRole(role); rolesView.refresh(); + + // refresh editors + IEditorReference[] refs = HandlerUtil.getActiveWorkbenchWindow(event) + .getActivePage() + .findEditors(null, ArgeoUserEditor.ID, IWorkbenchPage.MATCH_ID); + for (IEditorReference ref : refs) { + ArgeoUserEditor userEditor = (ArgeoUserEditor) ref.getEditor(false); + if (userEditor != null) { + userEditor.refresh(); + } + } return null; }