Skip to content
Snippets Groups Projects
Commit f4d5c17a authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

YELLOW

refs 2093
parent 9cfee0b1
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,7 @@ import org.eclipse.ui.PlatformUI;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 444CFF71C438482B444C6D47298AEA35
* @ConQAT.Rating YELLOW Hash: D6FFC35BDDDC1B74C1E2333BBC849ABA
*/
public final class EObjectSelectionUtils {
......@@ -68,18 +68,13 @@ public final class EObjectSelectionUtils {
*/
public static EObject getFirstElement(ISelection selection) {
if(selection instanceof IStructuredSelection && !selection.isEmpty()) {
return EObjectOfObject(((IStructuredSelection)selection).getFirstElement());
return eObjectOfObject(((IStructuredSelection)selection).getFirstElement());
}
return null;
}
/**
* TODO: B.13
* TODO (dan): the name of this method is really strange - it breaks the Java and AF3 naming
* conventions
* Try to retrieve an EObject from an Object.
*/
private static EObject EObjectOfObject(Object o) {
/** Try to retrieve an EObject from an Object. */
private static EObject eObjectOfObject(Object o) {
if(o instanceof EObject) {
return (EObject)o;
}
......@@ -121,7 +116,7 @@ public final class EObjectSelectionUtils {
List<EObject> result = new ArrayList<EObject>();
if(selection instanceof StructuredSelection && !selection.isEmpty()) {
for(Object o : ((StructuredSelection)selection).toList()) {
EObject eo = EObjectOfObject(o);
EObject eo = eObjectOfObject(o);
if(eo != null) {
result.add(eo);
} else if(o instanceof IAdaptable) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment