use of com.google.security.zynamics.binnavi.API.disassembly.Database in project binnavi by google.
the class View2D method findView.
/**
* Searches for the API view that wraps a given internal view.
*
* @param database Database to search for.
* @param internalView Internal view to search for.
* @param databases Databases to search through.
*
* @return The API view that wraps the given internal view.
*/
private static View findView(final IDatabase database, final INaviView internalView, final List<Database> databases) {
final Database apiDatabase = ObjectFinders.getObject(database, databases);
View view = null;
for (final Module m : apiDatabase.getModules()) {
if (!m.isLoaded()) {
continue;
}
view = ObjectFinders.getObject(internalView, m.getViews());
if (view != null) {
return view;
}
}
for (final Project project : apiDatabase.getProjects()) {
if (!project.isLoaded()) {
continue;
}
view = ObjectFinders.getObject(internalView, project.getViews());
if (view != null) {
return view;
}
}
throw new IllegalStateException("Error: Unknown view");
}
Aggregations