feat(presenter): connect collection creation and viewing flows
This commit is contained in:
@@ -23,6 +23,7 @@ public final class App {
|
|||||||
MultiWindowTextGUI gui = new MultiWindowTextGUI(screen);
|
MultiWindowTextGUI gui = new MultiWindowTextGUI(screen);
|
||||||
|
|
||||||
AppState state = new AppState();
|
AppState state = new AppState();
|
||||||
|
|
||||||
MainView view = new MainView();
|
MainView view = new MainView();
|
||||||
|
|
||||||
MainPresenter presenter = new MainPresenter(state, view, gui);
|
MainPresenter presenter = new MainPresenter(state, view, gui);
|
||||||
|
|||||||
@@ -2,16 +2,27 @@ package ru.project.presenter;
|
|||||||
|
|
||||||
import com.googlecode.lanterna.gui2.WindowBasedTextGUI;
|
import com.googlecode.lanterna.gui2.WindowBasedTextGUI;
|
||||||
import ru.project.model.AppState;
|
import ru.project.model.AppState;
|
||||||
|
import ru.project.view.CollectionView;
|
||||||
|
import ru.project.view.CreateCollectionView;
|
||||||
import ru.project.view.MainView;
|
import ru.project.view.MainView;
|
||||||
|
|
||||||
public class MainPresenter extends BasePresenter {
|
public class MainPresenter extends BasePresenter {
|
||||||
|
|
||||||
private final MainView view;
|
private final MainView view;
|
||||||
|
|
||||||
|
private final CollectionPresenter collectionPresenter;
|
||||||
|
private final CreateCollectionPresenter createCollectionPresenter;
|
||||||
|
|
||||||
public MainPresenter(AppState state, MainView view, WindowBasedTextGUI gui) {
|
public MainPresenter(AppState state, MainView view, WindowBasedTextGUI gui) {
|
||||||
super(state, gui);
|
super(state, gui);
|
||||||
|
|
||||||
this.view = view;
|
this.view = view;
|
||||||
|
|
||||||
|
this.collectionPresenter = new CollectionPresenter(state, new CollectionView(), gui);
|
||||||
|
|
||||||
|
this.createCollectionPresenter =
|
||||||
|
new CreateCollectionPresenter(state, new CreateCollectionView(), gui);
|
||||||
|
|
||||||
bindActions();
|
bindActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,11 +42,11 @@ public class MainPresenter extends BasePresenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showCollection() {
|
private void showCollection() {
|
||||||
// TODO
|
collectionPresenter.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createCollection() {
|
private void createCollection() {
|
||||||
// TODO
|
createCollectionPresenter.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveCollection() {
|
private void saveCollection() {
|
||||||
|
|||||||
Reference in New Issue
Block a user