Skip to content

Commit

Permalink
Fixes bug on "Hierarchy Type" dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed May 6, 2015
1 parent bfe519d commit a833eab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class OpenTypeHierarchyController implements IndexesChangeListener {
openTypeHierarchyView.swing.mainFrame.rootPane.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR))
for (def indexes : collectionOfIndexes) { indexes.waitIndexers() }
openTypeHierarchyView.swing.mainFrame.rootPane.setCursor(Cursor.getDefaultCursor())

// Prepare view
openTypeHierarchyView.updateTree(entry, typeName)
// Show
openTypeHierarchyView.show()
Expand Down
8 changes: 3 additions & 5 deletions app/src/main/groovy/jd/gui/view/OpenTypeHierarchyView.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class OpenTypeHierarchyView {
Closure onTypeSelectedClosure
Closure getSubTypeNamesClosure
Closure getEntriesClosure
Container.Entry entry
String typeName

OpenTypeHierarchyView(
SwingBuilder swing, Configuration configuration, API api,
Expand Down Expand Up @@ -114,9 +112,6 @@ class OpenTypeHierarchyView {

void updateTree(Container.Entry entry, String typeName) {
swing.doLater {
// Store current entry and type name
this.entry = entry
this.typeName = typeName
// Clear tree
JTree tree = swing.openTypeHierarchyTree
def model = tree.model
Expand Down Expand Up @@ -160,6 +155,9 @@ class OpenTypeHierarchyView {

TreeNode createTreeNode(Container.Entry entry, String typeName) {
def type = api.getTypeFactory(entry).make(api, entry, typeName)

typeName = type.name

def entries = getEntriesClosure(typeName)
def treeNode = new TreeNode(entry, typeName, entries, new TreeNodeBean(type))
def childTypeNames = getSubTypeNamesClosure(typeName)
Expand Down

0 comments on commit a833eab

Please sign in to comment.