1 package org
.argeo
.slc
.client
.ui
.dist
.commands
;
3 import org
.argeo
.slc
.client
.ui
.dist
.DistPlugin
;
4 import org
.argeo
.slc
.client
.ui
.dist
.editors
.DistributionEditor
;
5 import org
.argeo
.slc
.client
.ui
.dist
.editors
.DistributionOverviewPage
;
6 import org
.eclipse
.core
.commands
.AbstractHandler
;
7 import org
.eclipse
.core
.commands
.ExecutionEvent
;
8 import org
.eclipse
.core
.commands
.ExecutionException
;
9 import org
.eclipse
.ui
.IWorkbenchPart
;
10 import org
.eclipse
.ui
.forms
.editor
.IFormPage
;
13 * Force refresh of the Distribution overview page of the corresponding editor
16 public class RefreshDistributionOverviewPage
extends AbstractHandler
{
17 // private static final Log log = LogFactory
18 // .getLog(RefreshDistributionOverviewPage.class);
19 public final static String ID
= DistPlugin
.ID
20 + ".refreshDistributionOverviewPage";
21 public final static String DEFAULT_LABEL
= "Refresh the distribution overview";
22 public final static String DEFAULT_ICON_PATH
= "icons/refresh.png";
24 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
25 IWorkbenchPart activePart
= DistPlugin
.getDefault().getWorkbench()
26 .getActiveWorkbenchWindow().getActivePage().getActivePart();
27 if (activePart
instanceof DistributionEditor
) {
28 IFormPage ifp
= ((DistributionEditor
) activePart
)
29 .getActivePageInstance();
30 if (ifp
instanceof DistributionOverviewPage
)
31 ((DistributionOverviewPage
) ifp
).refresh();