blob: 5f7f5b5695085b3870bea2351431e4fa3874392a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
/*****************************************************************************
* Copyright (c) 2011 AtoS.
*
* All rights reserved. This program and the accompanying materials
* 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:
* Tristan FAURE (AtoS) tristan.faure@atos.net - Initial API and implementation
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.palette.customaction.utils;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.ReflectiveItemProvider;
/**
* Utility methods for provider
* @author tfaure
*
*/
public class ProviderUtil {
/**
* Return the label of the eobject
* @param eobject
* @return
*/
public static String getLabel (EObject eobject)
{
return new ReflectiveItemProvider(new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE)).getText(eobject);
}
}
|