MCPcopy Create free account
hub / github.com/FabricMC/Matcher / createClassList

Method createClassList

src/main/java/matcher/gui/MatchPaneSrc.java:161–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159 }
160
161 private Node createClassList() {
162 if (useClassTree) {
163 classList = null;
164 classTree = new TreeView<>(new TreeItem<>(null));
165
166 classTree.setShowRoot(false);
167 classTree.setCellFactory(ignore -> new SrcTreeCell());
168 classTree.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
169 if (suppressChangeEvents || oldValue == newValue) return;
170
171 onClassSelect(newValue != null && newValue.getValue() instanceof ClassInstance ? (ClassInstance) newValue.getValue() : null);
172 });
173
174 return classTree;
175 } else {
176 classTree = null;
177 classList = new ListView<>();
178
179 classList.setCellFactory(ignore -> new SrcListCell<>());
180 classList.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
181 if (suppressChangeEvents || oldValue == newValue) return;
182
183 onClassSelect(newValue);
184 });
185
186 return classList;
187 }
188 }
189
190 private class SrcListCell<T extends Matchable<? extends T>> extends StyledListCell<T> {
191 @Override

Callers 2

initMethod · 0.95
onViewChangeMethod · 0.95

Calls 2

onClassSelectMethod · 0.95
addListenerMethod · 0.80

Tested by

no test coverage detected