Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-07-27 08:26:28 +0000
committerEike Stepper2015-07-27 08:26:28 +0000
commit717eaaafeb3ecac0f1e0771f6beee23f7d644f6a (patch)
tree79b348122203e652ed414dea3bddd72bd29c6289 /plugins/org.eclipse.emf.cdo.explorer/src
parent983167d98f5e832754c895d6dd0763ddf45ea9a0 (diff)
downloadcdo-717eaaafeb3ecac0f1e0771f6beee23f7d644f6a.tar.gz
cdo-717eaaafeb3ecac0f1e0771f6beee23f7d644f6a.tar.xz
cdo-717eaaafeb3ecac0f1e0771f6beee23f7d644f6a.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/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerElement.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerUtil.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/AbstractElement.java14
3 files changed, 40 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerElement.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerElement.java
index 9f1b2bab5b..94e816a285 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerElement.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerElement.java
@@ -16,6 +16,8 @@ import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.core.runtime.IAdaptable;
+import java.io.File;
+
/**
* A CDO server independent representation of a repository.
*
@@ -38,5 +40,10 @@ public interface CDOExplorerElement extends INotifier, IAdaptable, Adapter, Comp
public void setDescription(String description);
+ /**
+ * @since 4.5
+ */
+ public File getStateFolder(String path);
+
public void delete(boolean deleteContents);
}
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerUtil.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerUtil.java
index 83efc00113..ae3a8c8207 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerUtil.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/explorer/CDOExplorerUtil.java
@@ -18,11 +18,13 @@ import org.eclipse.emf.cdo.explorer.repositories.CDORepositoryManager;
import org.eclipse.emf.cdo.internal.explorer.bundle.OM;
import org.eclipse.emf.cdo.internal.explorer.checkouts.CDOCheckoutImpl;
import org.eclipse.emf.cdo.internal.explorer.checkouts.CDOCheckoutViewProvider;
+import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.net4j.util.AdapterUtil;
import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -70,7 +72,23 @@ public final class CDOExplorerUtil
return getCheckoutManager().getCheckout(id);
}
- return walkUp(object, null);
+ CDOCheckout checkout = walkUp(object, null);
+ if (checkout != null)
+ {
+ return checkout;
+ }
+
+ if (object instanceof Notifier)
+ {
+ Notifier notifier = (Notifier)object;
+ CDOView view = CDOUtil.getView(notifier);
+ if (view != null)
+ {
+ return getCheckout(view);
+ }
+ }
+
+ return null;
}
public static Object getParent(Object object)
diff --git a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/AbstractElement.java b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/AbstractElement.java
index ef3970d082..55ffdfab03 100644
--- a/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/AbstractElement.java
+++ b/plugins/org.eclipse.emf.cdo.explorer/src/org/eclipse/emf/cdo/internal/explorer/AbstractElement.java
@@ -238,6 +238,20 @@ public abstract class AbstractElement extends Notifier implements CDOExplorerEle
return label1.compareTo(label2);
}
+ /**
+ * @since 4.5
+ */
+ public File getStateFolder(String path)
+ {
+ File stateFolder = new File(folder, path);
+ if (!stateFolder.exists())
+ {
+ stateFolder.mkdirs();
+ }
+
+ return stateFolder;
+ }
+
public void delete(boolean deleteContents)
{
if (deleteContents)

Back to the top