1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.argeo.cms.ui.workbench.internal.useradmin.commands;
17
18 import org.argeo.cms.ui.workbench.internal.useradmin.parts.GroupsView;
19 import org.argeo.cms.ui.workbench.internal.useradmin.parts.UsersView;
20 import org.eclipse.core.commands.AbstractHandler;
21 import org.eclipse.core.commands.ExecutionEvent;
22 import org.eclipse.core.commands.ExecutionException;
23 import org.eclipse.ui.IWorkbenchPage;
24 import org.eclipse.ui.IWorkbenchPart;
25 import org.eclipse.ui.IWorkbenchWindow;
26 import org.eclipse.ui.handlers.HandlerUtil;
27
28
29 public class ForceRefresh extends AbstractHandler {
30
31 public Object execute(ExecutionEvent event) throws ExecutionException {
32 IWorkbenchWindow iww = HandlerUtil.getActiveWorkbenchWindow(event);
33 if (iww == null)
34 return null;
35 IWorkbenchPage activePage = iww.getActivePage();
36 IWorkbenchPart part = activePage.getActivePart();
37 if (part instanceof UsersView)
38 ((UsersView) part).refresh();
39 else if (part instanceof GroupsView)
40 ((GroupsView) part).refresh();
41 return null;
42 }
43 }