use of com.google.security.zynamics.binnavi.disassembly.CProjectContainer in project binnavi by google.
the class PluginInterface method showInWindow.
/**
* Shows a view in a given window.
*
* @param window The window where the view is shown.
* @param view The view to show.
*
* @return The view2d object that is shown.
*/
public View2D showInWindow(final GraphWindow window, 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(window.getNative(), view, new CModuleContainer(container.getDatabase().getNative(), module.getNative()));
} else {
final Project project = (Project) container;
return show(window.getNative(), view, new CProjectContainer(container.getDatabase().getNative(), project.getNative()));
}
}
use of com.google.security.zynamics.binnavi.disassembly.CProjectContainer in project binnavi by google.
the class CAddressSpaceNodeTest method setUp.
@Before
public void setUp() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException, FileReadException, CouldntLoadDataException, CouldntSaveDataException, LoadCancelledException {
ConfigManager.instance().read();
m_database = new MockDatabase(m_provider);
m_project = new CProject(1, "Mock Project", "Mock Project Description", new Date(), new Date(), 0, new ArrayList<DebuggerTemplate>(), m_provider);
m_project.load();
m_addressSpace = m_project.getContent().createAddressSpace("Address Space");
final CProjectTreeModel model = new CProjectTreeModel(m_tree);
model.setRoot(new DefaultMutableTreeNode());
m_tree.setModel(model);
assertTrue(((LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(m_database, "listeners"), "m_listeners")) == null);
assertTrue(((LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(m_project, "m_listeners"), "m_listeners")) == null);
assertTrue(((LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(m_addressSpace, "m_listeners"), "m_listeners")) == null);
assertTrue(((LinkedHashSet<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(ZyGraphBuilderManager.instance(), "m_listeners"), "m_listeners")) == null);
m_container = new CProjectContainer(m_database, m_project, m_addressSpace);
}
use of com.google.security.zynamics.binnavi.disassembly.CProjectContainer in project binnavi by google.
the class CProjectNodeTest method testChangingName.
@Test
public void testChangingName() throws CouldntSaveDataException {
final CProjectNode node = new CProjectNode(m_tree, new DefaultMutableTreeNode(), m_database, m_project, new CProjectContainer(m_database, m_project));
assertEquals("Name (0)", node.toString());
m_project.getConfiguration().setName("Hannes");
assertEquals("Hannes (0)", node.toString());
}
use of com.google.security.zynamics.binnavi.disassembly.CProjectContainer in project binnavi by google.
the class CProjectContainerTest method testGetViews.
@Test
public void testGetViews() {
final CProjectContainer container = new CProjectContainer(m_database, m_project);
final INaviView view = container.createView("view1", "information");
assertEquals(3, container.getViews().size());
assertTrue(container.getViews().contains(view));
}
use of com.google.security.zynamics.binnavi.disassembly.CProjectContainer in project binnavi by google.
the class CProjectContainerTest method testGetView.
@Test
public void testGetView() {
final CProjectContainer container = new CProjectContainer(m_database, m_project);
@SuppressWarnings("unused") final INaviView view = container.createView("foo", "berT");
assertNull(container.getView(m_function));
}
Aggregations