]>
git.argeo.org Git - gpl/argeo-slc.git/blob - plugins/org.argeo.slc.akb.ui/src/main/java/org/argeo/slc/akb/ui/commands/ForceRefresh.java
1 package org
.argeo
.slc
.akb
.ui
.commands
;
3 import org
.argeo
.slc
.akb
.ui
.AkbUiPlugin
;
4 import org
.argeo
.slc
.akb
.ui
.utils
.Refreshable
;
5 import org
.eclipse
.core
.commands
.AbstractHandler
;
6 import org
.eclipse
.core
.commands
.ExecutionEvent
;
7 import org
.eclipse
.core
.commands
.ExecutionException
;
8 import org
.eclipse
.ui
.IWorkbenchPart
;
9 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
12 * Force refreshment of the active part if it implements
13 * <Code>Refreshable</code> interface.
15 public class ForceRefresh
extends AbstractHandler
{
17 public final static String ID
= AkbUiPlugin
.PLUGIN_ID
+ ".forceRefresh";
19 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
21 IWorkbenchPart part
= HandlerUtil
.getActiveWorkbenchWindow(event
)
22 .getActivePage().getActivePart();
23 if (part
instanceof Refreshable
)
24 ((Refreshable
) part
).forceRefresh(null);