Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-07-18 08:27:38 +0000
committerEike Stepper2015-07-18 08:27:38 +0000
commit3469e7b87e0db45ceeef02d6d0c6310912989dda (patch)
tree52fa7c45facd84cc297bc082f9eaadac15eed79b /plugins/org.eclipse.emf.cdo.explorer.ui
parent504b4e687c057d5b29bc7ff461dea2e840602185 (diff)
downloadcdo-3469e7b87e0db45ceeef02d6d0c6310912989dda.tar.gz
cdo-3469e7b87e0db45ceeef02d6d0c6310912989dda.tar.xz
cdo-3469e7b87e0db45ceeef02d6d0c6310912989dda.zip
[458349] Consolidate UI
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458349
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.explorer.ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/ShowInActionProvider.java38
1 files changed, 32 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/ShowInActionProvider.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/ShowInActionProvider.java
index b6261e1490..a391a2d4cf 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/ShowInActionProvider.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/ShowInActionProvider.java
@@ -30,6 +30,7 @@ import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
import org.eclipse.emf.cdo.spi.workspace.InternalCDOWorkspace;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.ui.internal.team.history.CDOHistoryAdapterFactory;
import org.eclipse.emf.cdo.ui.shared.SharedIcons;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.cdo.view.CDOView;
@@ -58,6 +59,7 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Sash;
+import org.eclipse.team.ui.history.IHistoryView;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IViewPart;
@@ -78,8 +80,6 @@ public class ShowInActionProvider extends AbstractActionProvider<Object>
private static final String ID = ShowInActionProvider.class.getName();
- private static final String HISTORY_VIEW_ID = "org.eclipse.team.ui.GenericHistoryView";
-
private static final String DASHBOARD_KEY = CDOCheckoutDashboard.class.getName();
public ShowInActionProvider()
@@ -127,7 +127,7 @@ public class ShowInActionProvider extends AbstractActionProvider<Object>
}
filled |= addAction(menu, repository, new ShowInSessionsViewAction(page, repository, null));
- filled |= addAction(menu, repository.getSession(), new ShowInViewAction(page, HISTORY_VIEW_ID));
+ filled |= addAction(menu, repository.getSession(), new ShowInHistoryAction(page, repository.getSession()));
}
else
{
@@ -143,7 +143,7 @@ public class ShowInActionProvider extends AbstractActionProvider<Object>
if (selectedElement instanceof CDOBranch)
{
- filled |= addAction(menu, selectedElement, new ShowInViewAction(page, HISTORY_VIEW_ID));
+ filled |= addAction(menu, selectedElement, new ShowInHistoryAction(page, selectedElement));
}
if (selectedElement instanceof CDOCheckout)
@@ -180,7 +180,7 @@ public class ShowInActionProvider extends AbstractActionProvider<Object>
filled |= addAction(menu, checkout, new ShowInViewAction(page, CDOTimeMachineView.ID));
}
- filled |= addAction(menu, checkout.getView(), new ShowInViewAction(page, HISTORY_VIEW_ID));
+ filled |= addAction(menu, checkout.getView(), new ShowInHistoryAction(page, checkout.getView()));
}
}
@@ -189,7 +189,7 @@ public class ShowInActionProvider extends AbstractActionProvider<Object>
EObject eObject = (EObject)selectedElement;
if (CDOExplorerUtil.getCheckout(eObject) != null)
{
- filled |= addAction(menu, selectedElement, new ShowInViewAction(page, HISTORY_VIEW_ID));
+ filled |= addAction(menu, eObject, new ShowInHistoryAction(page, eObject));
}
}
@@ -436,6 +436,32 @@ public class ShowInActionProvider extends AbstractActionProvider<Object>
/**
* @author Eike Stepper
*/
+ private static final class ShowInHistoryAction extends ShowInViewAction
+ {
+ private static final String HISTORY_VIEW_ID = "org.eclipse.team.ui.GenericHistoryView";
+
+ private final Object selectedElement;
+
+ public ShowInHistoryAction(IWorkbenchPage page, Object selectedElement)
+ {
+ super(page, HISTORY_VIEW_ID);
+ this.selectedElement = selectedElement;
+ }
+
+ @Override
+ protected void run(IViewPart viewPart) throws Exception
+ {
+ if (selectedElement != null)
+ {
+ CDOHistoryAdapterFactory.load();
+ ((IHistoryView)viewPart).showHistoryFor(selectedElement);
+ }
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
private static final class ShowInProjectExplorerAction extends ShowInViewAction
{
private final CDOCheckout[] checkouts;

Back to the top