Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-03-19 10:53:31 +0000
committerEike Stepper2012-03-19 10:53:31 +0000
commitadbb257973866c3c389a636251cb7fe9180ff763 (patch)
treec447a19849abcad4df5ff4d24480e356246a5fe7 /plugins/org.eclipse.emf.cdo.edit
parent947126c22b8708b2b974c50e4541f4551005ac29 (diff)
downloadcdo-adbb257973866c3c389a636251cb7fe9180ff763.tar.gz
cdo-adbb257973866c3c389a636251cb7fe9180ff763.tar.xz
cdo-adbb257973866c3c389a636251cb7fe9180ff763.zip
Enhance getText() in Eresource item providers
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.edit')
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOBinaryResourceItemProvider.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOFileResourceItemProvider.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java35
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOTextResourceItemProvider.java20
4 files changed, 46 insertions, 47 deletions
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOBinaryResourceItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOBinaryResourceItemProvider.java
index 134dddfec1..e57b71ba40 100644
--- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOBinaryResourceItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOBinaryResourceItemProvider.java
@@ -36,7 +36,7 @@ import java.util.List;
/**
* This is the item provider adapter for a {@link org.eclipse.emf.cdo.eresource.CDOBinaryResource} object. <!--
* begin-user-doc -->
- *
+ *
* @since 4.1
* @noextend This class is not intended to be subclassed by clients. <!-- end-user-doc -->
* @generated
@@ -47,7 +47,7 @@ public class CDOBinaryResourceItemProvider extends CDOFileResourceItemProvider i
{
/**
* This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
public CDOBinaryResourceItemProvider(AdapterFactory adapterFactory)
@@ -57,7 +57,7 @@ public class CDOBinaryResourceItemProvider extends CDOFileResourceItemProvider i
/**
* This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -74,7 +74,7 @@ public class CDOBinaryResourceItemProvider extends CDOFileResourceItemProvider i
/**
* This adds a property descriptor for the Contents feature. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addContentsPropertyDescriptor(Object object)
@@ -92,7 +92,7 @@ public class CDOBinaryResourceItemProvider extends CDOFileResourceItemProvider i
/**
* This returns CDOBinaryResource.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -103,21 +103,21 @@ public class CDOBinaryResourceItemProvider extends CDOFileResourceItemProvider 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 = ((CDOBinaryResource)object).getName();
return label == null || label.length() == 0 ? getString("_UI_CDOBinaryResource_type") : //$NON-NLS-1$
- getString("_UI_CDOBinaryResource_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating a
* viewer notification, which it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -137,7 +137,7 @@ public class CDOBinaryResourceItemProvider extends CDOFileResourceItemProvider i
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created under
* this object. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOFileResourceItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOFileResourceItemProvider.java
index cd03523df5..9ee74e48f0 100644
--- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOFileResourceItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOFileResourceItemProvider.java
@@ -28,7 +28,7 @@ import java.util.List;
/**
* This is the item provider adapter for a {@link org.eclipse.emf.cdo.eresource.CDOFileResource} object. <!--
* begin-user-doc -->
- *
+ *
* @since 4.1
* @noextend This class is not intended to be subclassed by clients. <!-- end-user-doc -->
* @generated
@@ -39,7 +39,7 @@ public class CDOFileResourceItemProvider extends CDOResourceLeafItemProvider imp
{
/**
* This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
public CDOFileResourceItemProvider(AdapterFactory adapterFactory)
@@ -49,7 +49,7 @@ public class CDOFileResourceItemProvider extends CDOResourceLeafItemProvider imp
/**
* This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -65,7 +65,7 @@ public class CDOFileResourceItemProvider extends CDOResourceLeafItemProvider imp
/**
* This returns CDOFileResource.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -76,21 +76,21 @@ public class CDOFileResourceItemProvider extends CDOResourceLeafItemProvider imp
/**
* 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 = ((CDOFileResource<?>)object).getName();
return label == null || label.length() == 0 ? getString("_UI_CDOFileResource_type") : //$NON-NLS-1$
- getString("_UI_CDOFileResource_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating a
* viewer notification, which it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -103,7 +103,7 @@ public class CDOFileResourceItemProvider extends CDOResourceLeafItemProvider imp
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created under
* this object. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
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 a5655c6335..ccb22ec70b 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
@@ -15,7 +15,6 @@ 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;
@@ -38,7 +37,7 @@ import java.util.List;
/**
* This is the item provider adapter for a {@link org.eclipse.emf.cdo.eresource.CDOResource} object. <!-- begin-user-doc
* -->
- *
+ *
* @noextend This class is not intended to be subclassed by clients. <!-- end-user-doc -->
* @generated
*/
@@ -48,7 +47,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
{
/**
* This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
public CDOResourceItemProvider(AdapterFactory adapterFactory)
@@ -58,7 +57,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -79,7 +78,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* This adds a property descriptor for the URI feature. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addURIPropertyDescriptor(Object object)
@@ -95,7 +94,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* This adds a property descriptor for the Modified feature. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addModifiedPropertyDescriptor(Object object)
@@ -111,7 +110,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* This adds a property descriptor for the Loaded feature. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addLoadedPropertyDescriptor(Object object)
@@ -128,7 +127,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* This adds a property descriptor for the Tracking Modification feature. <!-- begin-user-doc --> <!-- end-user-doc
* -->
- *
+ *
* @generated
*/
protected void addTrackingModificationPropertyDescriptor(Object object)
@@ -146,7 +145,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* This adds a property descriptor for the Time Stamp feature. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addTimeStampPropertyDescriptor(Object object)
@@ -165,7 +164,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. <!-- begin-user-doc --> <!--
* end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -181,7 +180,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -195,7 +194,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* This returns CDOResource.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -206,20 +205,20 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated NOT
*/
@Override
public String getText(Object object)
{
CDOResource resource = (CDOResource)object;
- URI uri = resource.getURI();
- return uri == null ? resource.toString() : uri.toString();
+ String name = resource.getName();
+ return name == null ? resource.toString() : name;
}
/**
* Returns the parent of the argument CDOResource
- *
+ *
* @ADDED
* @since 2.0
*/
@@ -238,7 +237,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating a
* viewer notification, which it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -268,7 +267,7 @@ public class CDOResourceItemProvider extends CDOResourceLeafItemProvider impleme
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created under
* this object. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated NOT
*/
@Override
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOTextResourceItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOTextResourceItemProvider.java
index 8f41423141..966328b315 100644
--- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOTextResourceItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOTextResourceItemProvider.java
@@ -32,7 +32,7 @@ import java.util.List;
/**
* This is the item provider adapter for a {@link org.eclipse.emf.cdo.eresource.CDOTextResource} object. <!--
* begin-user-doc -->
- *
+ *
* @since 4.1
* @noextend This class is not intended to be subclassed by clients. <!-- end-user-doc -->
* @generated
@@ -43,7 +43,7 @@ public class CDOTextResourceItemProvider extends CDOFileResourceItemProvider imp
{
/**
* This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
public CDOTextResourceItemProvider(AdapterFactory adapterFactory)
@@ -53,7 +53,7 @@ public class CDOTextResourceItemProvider extends CDOFileResourceItemProvider imp
/**
* This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -70,7 +70,7 @@ public class CDOTextResourceItemProvider extends CDOFileResourceItemProvider imp
/**
* This adds a property descriptor for the Contents feature. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addContentsPropertyDescriptor(Object object)
@@ -87,7 +87,7 @@ public class CDOTextResourceItemProvider extends CDOFileResourceItemProvider imp
/**
* This returns CDOTextResource.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -98,21 +98,21 @@ public class CDOTextResourceItemProvider extends CDOFileResourceItemProvider imp
/**
* 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 = ((CDOTextResource)object).getName();
return label == null || label.length() == 0 ? getString("_UI_CDOTextResource_type") : //$NON-NLS-1$
- getString("_UI_CDOTextResource_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
+ label;
}
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached children and by creating a
* viewer notification, which it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -132,7 +132,7 @@ public class CDOTextResourceItemProvider extends CDOFileResourceItemProvider imp
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be created under
* this object. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override

Back to the top