Search in sources :

Example 36 with DefaultMutableTreeNode

use of javax.swing.tree.DefaultMutableTreeNode in project binnavi by google.

the class CDebuggerNodeTest method testListenersRemoved.

@Test
public void testListenersRemoved() throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException {
    final CDebuggerNode node = new CDebuggerNode(m_tree, new DefaultMutableTreeNode(), m_database, m_template);
    node.dispose();
    assertTrue(((Collection<?>) ReflectionHelpers.getField(ReflectionHelpers.getField(m_database, "listeners"), "m_listeners")) == null);
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CDebuggerNode(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Debugger.CDebuggerNode) Test(org.junit.Test)

Example 37 with DefaultMutableTreeNode

use of javax.swing.tree.DefaultMutableTreeNode in project binnavi by google.

the class CDebuggerNodeTest method testConstructor.

@Test
public void testConstructor() {
    final CDebuggerNode node = new CDebuggerNode(m_tree, new DefaultMutableTreeNode(), m_database, m_template);
    assertEquals(m_template, node.getObject());
    assertNotNull(node.getComponent());
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CDebuggerNode(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Debugger.CDebuggerNode) Test(org.junit.Test)

Example 38 with DefaultMutableTreeNode

use of javax.swing.tree.DefaultMutableTreeNode in project binnavi by google.

the class TypesTreeModelTests method testTypeUpdated.

@Test
public void testTypeUpdated() throws CouldntSaveDataException {
    final DefaultMutableTreeNode root = createModel();
    typeManager.updateType(typeSystem.simpleStruct, "AAAAA", typeSystem.simpleStruct.getBitSize(), false);
    final Multimap<Integer, DefaultMutableTreeNode> nodesByLevel = getNodesByLevel(root);
    Assert.assertEquals(LEVEL_0_NODES, nodesByLevel.get(0).size());
    Assert.assertEquals(LEVEL_1_NODES, nodesByLevel.get(1).size());
    Assert.assertEquals(LEVEL_2_NODES, nodesByLevel.get(2).size());
    Assert.assertEquals(LEVEL_3_NODES, nodesByLevel.get(3).size());
    Assert.assertEquals(LEVEL_4_NODES, nodesByLevel.get(4).size());
    verifySorted(root);
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) Test(org.junit.Test)

Example 39 with DefaultMutableTreeNode

use of javax.swing.tree.DefaultMutableTreeNode in project binnavi by google.

the class TypesTreeModelTests method testDefaultConstructor.

@Test
public void testDefaultConstructor() {
    final DefaultMutableTreeNode root = createModel();
    final Multimap<Integer, DefaultMutableTreeNode> nodesByLevel = getNodesByLevel(root);
    Assert.assertEquals(LEVEL_0_NODES, nodesByLevel.get(0).size());
    Assert.assertEquals(LEVEL_1_NODES, nodesByLevel.get(1).size());
    Assert.assertEquals(LEVEL_2_NODES, nodesByLevel.get(2).size());
    Assert.assertEquals(LEVEL_3_NODES, nodesByLevel.get(3).size());
    Assert.assertEquals(LEVEL_4_NODES, nodesByLevel.get(4).size());
    verifySorted(root);
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) Test(org.junit.Test)

Example 40 with DefaultMutableTreeNode

use of javax.swing.tree.DefaultMutableTreeNode in project binnavi by google.

the class TypesTreeModelTests method testMemberAdded.

@Test
public void testMemberAdded() throws CouldntSaveDataException {
    final DefaultMutableTreeNode root = createModel();
    typeManager.appendMember(typeSystem.simpleStruct, typeSystem.intType, "new_member");
    final Multimap<Integer, DefaultMutableTreeNode> nodesByLevel = getNodesByLevel(root);
    Assert.assertEquals(LEVEL_0_NODES, nodesByLevel.get(0).size());
    Assert.assertEquals(LEVEL_1_NODES, nodesByLevel.get(1).size());
    Assert.assertEquals(LEVEL_2_NODES + 1, nodesByLevel.get(2).size());
    Assert.assertEquals(LEVEL_3_NODES + 2, nodesByLevel.get(3).size());
    Assert.assertEquals(LEVEL_4_NODES + 1, nodesByLevel.get(4).size());
    verifySorted(root);
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) Test(org.junit.Test)

Aggregations

DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)692 TreePath (javax.swing.tree.TreePath)185 DefaultTreeModel (javax.swing.tree.DefaultTreeModel)98 ArrayList (java.util.ArrayList)51 Nullable (org.jetbrains.annotations.Nullable)50 TreeNode (javax.swing.tree.TreeNode)42 Test (org.junit.Test)39 JTree (javax.swing.JTree)38 NotNull (org.jetbrains.annotations.NotNull)32 VirtualFile (com.intellij.openapi.vfs.VirtualFile)28 JScrollPane (javax.swing.JScrollPane)25 TreeSelectionEvent (javax.swing.event.TreeSelectionEvent)23 TreeSelectionListener (javax.swing.event.TreeSelectionListener)23 Module (com.intellij.openapi.module.Module)20 File (java.io.File)20 Tree (com.intellij.ui.treeStructure.Tree)19 Enumeration (java.util.Enumeration)19 MouseEvent (java.awt.event.MouseEvent)18 IOException (java.io.IOException)17 MProduct (org.compiere.model.MProduct)17