|
|
@ -29,40 +29,41 @@ public class UpmShowPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
UpmShowPane() { |
|
|
|
UpmShowPane() { |
|
|
|
setLayout(new BorderLayout()); |
|
|
|
setLayout(new BorderLayout()); |
|
|
|
if (UpmFinder.checkUPMResourcesExist()) { |
|
|
|
// 先屏蔽掉这个判断,后续可能修改交互
|
|
|
|
modernUIPane = new ModernUIPane.Builder<>() |
|
|
|
// if (UpmFinder.checkUPMResourcesExist()) {
|
|
|
|
.prepare(new ScriptContextAdapter() { |
|
|
|
modernUIPane = new ModernUIPane.Builder<>() |
|
|
|
@Override |
|
|
|
.prepare(new ScriptContextAdapter() { |
|
|
|
public void onScriptContextCreated(ScriptContextEvent event) { |
|
|
|
@Override |
|
|
|
JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); |
|
|
|
public void onScriptContextCreated(ScriptContextEvent event) { |
|
|
|
window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser())); |
|
|
|
JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); |
|
|
|
} |
|
|
|
window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser())); |
|
|
|
}) |
|
|
|
} |
|
|
|
.withURL(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()) |
|
|
|
}) |
|
|
|
.build(); |
|
|
|
.withURL(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()) |
|
|
|
EventDispatcher.listen(DownloadEvent.UPDATE, new Listener<String>() { |
|
|
|
.build(); |
|
|
|
@Override |
|
|
|
EventDispatcher.listen(DownloadEvent.UPDATE, new Listener<String>() { |
|
|
|
public void on(Event event, String param) { |
|
|
|
@Override |
|
|
|
modernUIPane.redirect(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()); |
|
|
|
public void on(Event event, String param) { |
|
|
|
} |
|
|
|
modernUIPane.redirect(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()); |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
}); |
|
|
|
modernUIPane = new ModernUIPane.Builder<>() |
|
|
|
// } else {
|
|
|
|
.withComponent(WarnComponent.KEY) |
|
|
|
// modernUIPane = new ModernUIPane.Builder<>()
|
|
|
|
.prepare(new ScriptContextAdapter() { |
|
|
|
// .withComponent(WarnComponent.KEY)
|
|
|
|
@Override |
|
|
|
// .prepare(new ScriptContextAdapter() {
|
|
|
|
public void onScriptContextCreated(ScriptContextEvent event) { |
|
|
|
// @Override
|
|
|
|
JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); |
|
|
|
// public void onScriptContextCreated(ScriptContextEvent event) {
|
|
|
|
window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser())); |
|
|
|
// JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window");
|
|
|
|
} |
|
|
|
// window.asObject().setProperty("PluginHelper", UpmBridge.getBridge(event.getBrowser()));
|
|
|
|
}).build(); |
|
|
|
// }
|
|
|
|
EventDispatcher.listen(DownloadEvent.SUCCESS, new Listener<String>() { |
|
|
|
// }).build();
|
|
|
|
@Override |
|
|
|
// EventDispatcher.listen(DownloadEvent.SUCCESS, new Listener<String>() {
|
|
|
|
public void on(Event event, String param) { |
|
|
|
// @Override
|
|
|
|
modernUIPane.redirect(UpmFinder.getMainResourcePath(), UpmUtils.renderMap()); |
|
|
|
// public void on(Event event, String param) {
|
|
|
|
} |
|
|
|
// modernUIPane.redirect(UpmFinder.getMainResourcePath(), UpmUtils.renderMap());
|
|
|
|
}); |
|
|
|
// }
|
|
|
|
} |
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
add(modernUIPane, BorderLayout.CENTER); |
|
|
|
add(modernUIPane, BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|