Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-06-13 17:06:54 +0000
committerEike Stepper2015-06-13 17:06:54 +0000
commite1bafc08969ea122f9757f15729f7d5627c5755e (patch)
tree5d3aec135257dbf953c7a3d24dcd4194ab5a9b58 /plugins/org.eclipse.emf.cdo.explorer.ui
parentf29f3ef744ad710ee46db696b0d2dcf4ccfecd39 (diff)
downloadcdo-e1bafc08969ea122f9757f15729f7d5627c5755e.tar.gz
cdo-e1bafc08969ea122f9757f15729f7d5627c5755e.tar.xz
cdo-e1bafc08969ea122f9757f15729f7d5627c5755e.zip
[467754] Resource removal doesn't work with Mars M7
https://bugs.eclipse.org/bugs/show_bug.cgi?id=467754
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.explorer.ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/plugin.xml8
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/ShowInActionProvider.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java14
3 files changed, 31 insertions, 12 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/plugin.xml b/plugins/org.eclipse.emf.cdo.explorer.ui/plugin.xml
index 36d4cc683b..c5c845e65b 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/plugin.xml
@@ -483,7 +483,9 @@
<iterate ifEmpty="false" operator="and">
<or>
<adapt type="org.eclipse.emf.cdo.CDOElement"/>
- <adapt type="org.eclipse.emf.ecore.EObject"/>
+ <adapt type="org.eclipse.emf.ecore.EObject">
+ <test property="org.eclipse.emf.cdo.explorer.object.inCheckout" value="true"/>
+ </adapt>
</or>
</iterate>
</activeWhen>
@@ -623,7 +625,9 @@
<iterate ifEmpty="false">
<or>
<adapt type="org.eclipse.emf.cdo.CDOElement"/>
- <adapt type="org.eclipse.emf.ecore.EObject"/>
+ <adapt type="org.eclipse.emf.ecore.EObject">
+ <test property="org.eclipse.emf.cdo.explorer.object.inCheckout" value="true"/>
+ </adapt>
</or>
</iterate>
</with>
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 2cdeb541fc..b6261e1490 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
@@ -114,14 +114,7 @@ public class ShowInActionProvider extends AbstractActionProvider<Object>
if (selectedElement instanceof CDORepository)
{
- final CDORepository repository = (CDORepository)selectedElement;
-
- CDOCheckout[] checkouts = repository.getCheckouts();
- if (checkouts.length != 0)
- {
- filled |= addAction(menu, repository, new ShowInProjectExplorerAction(page, checkouts));
- }
-
+ CDORepository repository = (CDORepository)selectedElement;
if (repository.isConnected())
{
if (repository.isLocal())
@@ -136,6 +129,16 @@ 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));
}
+ else
+ {
+ filled |= addAction(menu, repository, new ShowInSessionsViewAction(page, repository, null));
+ }
+
+ CDOCheckout[] checkouts = repository.getCheckouts();
+ if (checkouts.length != 0)
+ {
+ filled |= addAction(menu, repository, new ShowInProjectExplorerAction(page, checkouts));
+ }
}
if (selectedElement instanceof CDOBranch)
@@ -541,6 +544,8 @@ public class ShowInActionProvider extends AbstractActionProvider<Object>
private CDOSession getSession()
{
+ repository.connect();
+
String description = repository.getURI();
int lastSlash = description.lastIndexOf('/');
description = description.substring(0, lastSlash) + "?repositoryName=" + repository.getName()
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java
index 28899bcd5a..1f8cf53f1f 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/properties/ExplorerUIAdapterFactory.java
@@ -193,8 +193,18 @@ public class ExplorerUIAdapterFactory implements IAdapterFactory
@Override
protected IStatus run(IProgressMonitor monitor)
{
+ CDOTransaction transaction;
+
CDOCheckout checkout = CDOExplorerUtil.getCheckout(resourceNode);
- CDOTransaction transaction = checkout.openTransaction();
+ if (checkout != null)
+ {
+ transaction = checkout.openTransaction();
+ }
+ else
+ {
+ CDOView view = resourceNode.cdoView();
+ transaction = view.getSession().openTransaction(view.getBranch());
+ }
CDOCommitInfo commitInfo = null;
@@ -214,7 +224,7 @@ public class ExplorerUIAdapterFactory implements IAdapterFactory
transaction.close();
}
- if (commitInfo != null)
+ if (commitInfo != null && checkout != null)
{
checkout.getView().waitForUpdate(commitInfo.getTimeStamp());

Back to the top