MCPcopy
hub / github.com/Col-E/Recaf / get

Method get

src/main/java/me/coley/recaf/ui/MainWindow.java:255–285  ·  view source on GitHub ↗

@param controller Window context. @return main window instance.

(GuiController controller)

Source from the content-addressed store, hash-verified

253 * @return main window instance.
254 */
255 public static MainWindow get(GuiController controller) {
256 if (window == null) {
257 MainWindow app = window = new MainWindow(controller);
258 VMUtil.tkIint();
259 Platform.runLater(() -> {
260 Stage stage = new Stage();
261 try {
262 // When Recaf is run as an agent on Java 11+ then there is some additional weird classloader logic
263 // with modules where it cannot resolve paths to resources. We can simply set the classloader here
264 // to point it to whatever classloader has loaded Recaf.
265 if (VMUtil.getVmVersion() >= 11 && InstrumentationResource.isActive() &&
266 Thread.currentThread().getContextClassLoader() == null) {
267 Thread.currentThread().setContextClassLoader(Recaf.class.getClassLoader());
268 }
269 // Initialize the JFX app once things are configured.
270 app.init();
271 app.start(stage);
272 } catch (Exception ex) {
273 throw new RuntimeException(ex);
274 }
275 // Disable CSS logger, it complains a lot about non-issues
276 try {
277 ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class)
278 .setLoggerLevel("javafx.css", "OFF");
279 } catch (IllegalArgumentException ignored) {
280 // Expected: logger may not exist
281 }
282 });
283 }
284 return window;
285 }
286
287 /**
288 * Clear open tabs and remove the current workspace navigator.

Callers 15

runMethod · 0.95
testRenamedMethodMethod · 0.45
testJadxMappingsMethod · 0.45
testFileDoesNotExistMethod · 0.45
remapManifestTestMethod · 0.45
testChainMethod · 0.45
testStyleLoadOrderMethod · 0.45
testRawIndicesMethod · 0.45
testNamedIndicesMethod · 0.45
testMixedIndicesMethod · 0.45

Calls 5

tkIintMethod · 0.95
getVmVersionMethod · 0.95
isActiveMethod · 0.95
startMethod · 0.95
initMethod · 0.80

Tested by 15

testRenamedMethodMethod · 0.36
testJadxMappingsMethod · 0.36
testFileDoesNotExistMethod · 0.36
remapManifestTestMethod · 0.36
testChainMethod · 0.36
testStyleLoadOrderMethod · 0.36
testRawIndicesMethod · 0.36
testNamedIndicesMethod · 0.36
testMixedIndicesMethod · 0.36