()
| 50 | } |
| 51 | |
| 52 | private void init() { |
| 53 | setId("match-pane-src"); |
| 54 | retrieveCellTextColors(); |
| 55 | |
| 56 | // lists |
| 57 | |
| 58 | SplitPane verticalPane = new SplitPane(); |
| 59 | getItems().add(verticalPane); |
| 60 | |
| 61 | // class list |
| 62 | |
| 63 | verticalPane.getItems().add(createClassList()); |
| 64 | |
| 65 | // member list |
| 66 | |
| 67 | memberList.setCellFactory(ignore -> new SrcListCell<MemberInstance<?>>()); |
| 68 | memberList.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { |
| 69 | if (suppressChangeEvents || oldValue == newValue) return; |
| 70 | |
| 71 | boolean wasMethod = oldValue instanceof MethodInstance; |
| 72 | boolean wasField = oldValue instanceof FieldInstance; |
| 73 | boolean isMethod = newValue instanceof MethodInstance; |
| 74 | boolean isField = newValue instanceof FieldInstance; |
| 75 | |
| 76 | if (wasMethod && isField |
| 77 | || wasField && isMethod) { |
| 78 | if (wasMethod) { |
| 79 | onMethodSelect(null); |
| 80 | } else { |
| 81 | onFieldSelect(null); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | if (isMethod || newValue == null && wasMethod) { |
| 86 | onMethodSelect((MethodInstance) newValue); |
| 87 | } else { |
| 88 | onFieldSelect((FieldInstance) newValue); |
| 89 | } |
| 90 | }); |
| 91 | |
| 92 | verticalPane.getItems().add(memberList); |
| 93 | |
| 94 | // method var list |
| 95 | |
| 96 | varList.setCellFactory(ignore -> new SrcListCell<MethodVarInstance>()); |
| 97 | varList.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> { |
| 98 | if (suppressChangeEvents || oldValue == newValue) return; |
| 99 | |
| 100 | onMethodVarSelect(newValue); |
| 101 | }); |
| 102 | |
| 103 | verticalPane.getItems().add(varList); |
| 104 | |
| 105 | // content |
| 106 | |
| 107 | ContentPane content = new ContentPane(gui, this, true); |
| 108 | components.add(content); |
| 109 | getItems().add(content); |
no test coverage detected