use of bisq.desktop.common.view.ViewLoader in project bisq-desktop by bisq-network.
the class BisqApp method showDebugWindow.
// Used for debugging trade process
private void showDebugWindow() {
ViewLoader viewLoader = injector.getInstance(ViewLoader.class);
View debugView = viewLoader.load(DebugView.class);
Parent parent = (Parent) debugView.getRoot();
Stage stage = new Stage();
stage.setScene(new Scene(parent));
// Don't translate, just for dev
stage.setTitle("Debug window");
stage.initModality(Modality.NONE);
stage.initStyle(StageStyle.UTILITY);
stage.initOwner(scene.getWindow());
stage.setX(primaryStage.getX() + primaryStage.getWidth() + 10);
stage.setY(primaryStage.getY());
stage.show();
}
use of bisq.desktop.common.view.ViewLoader in project bisq-desktop by bisq-network.
the class CachingViewLoaderTests method test.
@Test
public void test() {
ViewLoader delegateViewLoader = mock(ViewLoader.class);
ViewLoader cachingViewLoader = new CachingViewLoader(delegateViewLoader);
cachingViewLoader.load(TestView1.class);
cachingViewLoader.load(TestView1.class);
cachingViewLoader.load(TestView2.class);
then(delegateViewLoader).should(times(1)).load(TestView1.class);
then(delegateViewLoader).should(times(1)).load(TestView2.class);
then(delegateViewLoader).should(times(0)).load(TestView3.class);
}
Aggregations