use of com.google.security.zynamics.binnavi.disassembly.INaviProject in project binnavi by google.
the class Database method convertData.
/**
* Converts the native objects stored in the database to API objects.
*/
private void convertData() {
m_viewTagManager = new TagManager(m_database.getContent().getViewTagManager());
m_nodeTagManager = new TagManager(m_database.getContent().getNodeTagManager());
m_modules.clear();
m_projects.clear();
for (final INaviModule module : m_database.getContent().getModules()) {
m_modules.add(new Module(this, module, m_nodeTagManager, m_viewTagManager));
}
for (final INaviProject project : m_database.getContent().getProjects()) {
m_projects.add(new Project(this, project, m_nodeTagManager, m_viewTagManager));
}
m_debuggerTemplateManager = new DebuggerTemplateManager(m_database.getContent().getDebuggerTemplateManager());
}
use of com.google.security.zynamics.binnavi.disassembly.INaviProject in project binnavi by google.
the class CProjectNode method doubleClicked.
@Override
public void doubleClicked() {
// Open projects on double-click.
if (!m_project.isLoaded()) {
final Action action = CActionProxy.proxy(new CLoadProjectAction(getProjectTree(), new INaviProject[] { m_project }));
action.actionPerformed(new ActionEvent(this, 0, ""));
}
}
use of com.google.security.zynamics.binnavi.disassembly.INaviProject in project binnavi by google.
the class PostgreSQLViewNotificationParser method parseProjectViewNotification.
/**
* Parser for the bn_project_views notification. The function uses the
* projectViewNotificationPattern to parse the incoming {@link PGNotification} into a
* {@link ViewNotificationContainer}
*
* @param notification The {@link PGNotification} to parse.
* @param provider The {@link SQLProvider} to access the database.
*/
private ViewNotificationContainer parseProjectViewNotification(final PGNotification notification, final SQLProvider provider) {
final Matcher matcher = projectViewNotificationPattern.matcher(notification.getParameter());
if (!matcher.find()) {
throw new IllegalStateException("IE02744: compiled pattern: " + projectViewNotificationPattern.toString() + " did not match notification: " + notification.getParameter());
}
final Integer viewId = Integer.parseInt(matcher.group(3));
final Optional<INaviView> view = Optional.fromNullable(ViewManager.get(provider).getView(viewId));
final Optional<Integer> projectId = Optional.fromNullable(Integer.parseInt(matcher.group(4)));
final Optional<INaviProject> project = Optional.fromNullable(provider.findProject(projectId.get()));
final String databaseOperation = matcher.group(2);
return new ViewNotificationContainer(viewId, view, projectId, Optional.<INaviModule>absent(), project, databaseOperation);
}
use of com.google.security.zynamics.binnavi.disassembly.INaviProject in project binnavi by google.
the class PostgreSQLProviderTestSetup method testCreateTraceProject4.
@Test
public void testCreateTraceProject4() throws CouldntSaveDataException {
final INaviProject project = loadProject();
final TraceList trace = getProvider().createTrace(project, "Trace Name", "Trace Description");
assertEquals("Trace Name", trace.getName());
assertEquals("Trace Description", trace.getDescription());
assertEquals(0, trace.getEventCount());
}
use of com.google.security.zynamics.binnavi.disassembly.INaviProject in project binnavi by google.
the class PostgreSQLProviderTest method testTraceFunctionsSetDescription1.
@Test
public void testTraceFunctionsSetDescription1() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
final INaviProject project = getProvider().createProject("SOME_PROJECT");
getProvider().createTrace(project, "SOME_TRACE", "SOME_TRACE_DESCRIPTION");
project.load();
final TraceList trace = project.getContent().getTraces().get(0);
assertEquals("SOME_TRACE_DESCRIPTION", project.getContent().getTraces().get(0).getDescription());
final String description = "boing boing";
PostgreSQLTraceFunctions.setDescription((AbstractSQLProvider) getProvider(), trace, description);
project.close();
INaviProject project2 = null;
for (final INaviProject cProject : getProvider().loadProjects()) {
if (cProject.getConfiguration().getId() == project.getConfiguration().getId()) {
project2 = cProject;
}
}
getProvider().createTrace(project2, "SOME_TRACE_2", "SOME_TRACE_DESCRIPTION_2");
project2.load();
final TraceList trace2 = project2.getContent().getTraces().get(0);
assertEquals(description, trace2.getDescription());
}
Aggregations