Skip to content

Commit

Permalink
TEIIDDES-2349 added method to return IProject for Object.
Browse files Browse the repository at this point in the history
  • Loading branch information
blafond committed Dec 9, 2014
1 parent 7d98eb7 commit 0df792f
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,19 @@ public static ModelResource getModelResource( Object object ) {
return null;
}

public static IProject getProject(Object object) {
ModelResource mr = getModelResource(object);

try {
return mr.getCorrespondingResource().getProject();
} catch (ModelWorkspaceException ex) {
String message = "[ModelUtilities.getProject()] ERROR: exception finding project"; //$NON-NLS-1$
UiConstants.Util.log(IStatus.ERROR, ex, message);
}

return null;
}

/**
*
* @param modelObject the eObject
Expand Down

0 comments on commit 0df792f

Please sign in to comment.