]> git.argeo.org Git - gpl/argeo-slc.git/blob - plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RefreshDistributionOverviewPage.java
243d12b4e7200bc3dda4b7b76fff52d80362c9ea
[gpl/argeo-slc.git] / plugins / org.argeo.slc.client.ui.dist / src / main / java / org / argeo / slc / client / ui / dist / commands / RefreshDistributionOverviewPage.java
1 package org.argeo.slc.client.ui.dist.commands;
2
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;
11
12 /**
13 * Force refresh of the Distribution overview page of the corresponding editor
14 */
15
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";
23
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();
32 }
33 return null;
34 }
35 }