summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Roldan Betancort2008-12-06 07:41:41 (EST)
committerVictor Roldan Betancort2008-12-06 07:41:41 (EST)
commitb17527fb79ddea633de0750216053dd74bdb47c5 (patch)
treed473ad545a6b3027dfeb6e54bf3f754eb385d563
parent429ed10e01fb72d0c472465e182f9de767130e29 (diff)
downloadcdo-b17527fb79ddea633de0750216053dd74bdb47c5.zip
cdo-b17527fb79ddea633de0750216053dd74bdb47c5.tar.gz
cdo-b17527fb79ddea633de0750216053dd74bdb47c5.tar.bz2
[250920] [UI] CDOResourceItemProvider should extend from ResourceItemProvider
https://bugs.eclipse.org/bugs/show_bug.cgi?id=250920
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/CDOResource.gifbin129 -> 345 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/CDOResourceFolder.gifbin131 -> 342 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceFolderItemProvider.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java27
4 files changed, 38 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/CDOResource.gif b/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/CDOResource.gif
index a3908bc..acd9c16 100644
--- a/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/CDOResource.gif
+++ b/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/CDOResource.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/CDOResourceFolder.gif b/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/CDOResourceFolder.gif
index 480c478..aa98255 100644
--- a/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/CDOResourceFolder.gif
+++ b/plugins/org.eclipse.emf.cdo.edit/icons/full/obj16/CDOResourceFolder.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceFolderItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceFolderItemProvider.java
index 9a648ee..3f53036 100644
--- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceFolderItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceFolderItemProvider.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: CDOResourceFolderItemProvider.java,v 1.2 2008-10-19 01:29:03 smcduff Exp $
+ * $Id: CDOResourceFolderItemProvider.java,v 1.3 2008-12-06 12:41:41 vroldanbet Exp $
*/
package org.eclipse.emf.cdo.eresource.provider;
@@ -107,14 +107,24 @@ public class CDOResourceFolderItemProvider extends CDOResourceNodeItemProvider i
/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
@Override
public String getText(Object object)
{
String label = ((CDOResourceFolder)object).getName();
- return label == null || label.length() == 0 ? getString("_UI_CDOResourceFolder_type")
- : getString("_UI_CDOResourceFolder_type") + " " + label;
+ return label == null || label.length() == 0 ? getString("_UI_CDOResourceFolder_type") + "?" : "/" + label;
+ }
+
+ /**
+ * Returns the parent of the folder. Might be another folder, or the root resource
+ *
+ * @ADDED
+ */
+ @Override
+ public Object getParent(Object object)
+ {
+ return ((CDOResourceFolder)object).eContainer();
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java
index 1ff7b4d..115a40b 100644
--- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java
@@ -4,18 +4,18 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
package org.eclipse.emf.cdo.eresource.provider;
-import org.eclipse.emf.cdo.common.CDOProtocolConstants;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.EresourcePackage;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
@@ -194,7 +194,28 @@ public class CDOResourceItemProvider extends CDOResourceNodeItemProvider impleme
public String getText(Object object)
{
CDOResource resource = (CDOResource)object;
- return CDOProtocolConstants.PROTOCOL_NAME + ":" + resource.getPath();
+ URI uri = resource.getURI();
+ return uri == null ? resource.toString() : uri.toString();
+ }
+
+ /**
+ * Returns the parent of the argument CDOResource
+ *
+ * @ADDED
+ * @since 2.0
+ */
+ @Override
+ public Object getParent(Object object)
+ {
+ CDOResource resource = (CDOResource)object;
+ if (resource.isRoot())
+ {
+ return resource.getResourceSet();
+ }
+ else
+ {
+ return resource.getFolder();
+ }
}
/**