use of com.google.security.zynamics.binnavi.API.disassembly.Project in project binnavi by google.
the class PluginInterface method showInNewWindow.
/**
* Shows a view in a new window.
*
* @param view The view to show.
*
* @return The view2d object that is shown.
*/
public View2D showInNewWindow(final View view) {
Preconditions.checkNotNull(view, "Error: View argument can not be null");
final ViewContainer container = view.getContainer();
if (container instanceof Module) {
final Module module = (Module) container;
return show(null, view, new CModuleContainer(container.getDatabase().getNative(), module.getNative()));
} else {
final Project project = (Project) container;
return show(null, view, new CProjectContainer(container.getDatabase().getNative(), project.getNative()));
}
}
use of com.google.security.zynamics.binnavi.API.disassembly.Project in project binnavi by google.
the class PluginInterface method showInLastWindow.
/**
* Shows a view in the last window.
*
* @param view The view to show.
*
* @return The view2d object that is shown.
*/
public View2D showInLastWindow(final View view) {
Preconditions.checkNotNull(view, "Error: View argument can not be null");
final ViewContainer container = view.getContainer();
if (container instanceof Module) {
final Module module = (Module) container;
return show(CWindowManager.instance().getLastWindow(), view, new CModuleContainer(container.getDatabase().getNative(), module.getNative()));
} else {
final Project project = (Project) container;
return show(CWindowManager.instance().getLastWindow(), view, new CProjectContainer(container.getDatabase().getNative(), project.getNative()));
}
}
use of com.google.security.zynamics.binnavi.API.disassembly.Project in project binnavi by google.
the class CProjectNodeMenuBuilder method getPluginProjects.
/**
* Returns the API project objects for the projects for which the menu was built.
*
* @return The API project objects.
*/
private List<Project> getPluginProjects() {
final DatabaseManager manager = PluginInterface.instance().getDatabaseManager();
for (final Database database : manager) {
if (database.getNative() == m_database) {
final List<Project> allProjects = database.getProjects();
final List<Project> menuProjects = new ArrayList<Project>();
for (final INaviProject project : m_projects) {
menuProjects.add(ObjectFinders.getObject(project, allProjects));
}
return menuProjects;
}
}
throw new IllegalStateException("IE01168: Unknown database");
}
use of com.google.security.zynamics.binnavi.API.disassembly.Project 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