-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructured ui #549
Restructured ui #549
Conversation
'Jump to nth card' shortcut triggers an NPE although the jump still happens. |
Would it be better if the |
Good point. That's the first design I tried i.e. each component had three parts.
But after implementing it (this was how I spent my entire Saturday!) I realized
Then I tried collapsing all three into one class and naming it |
logger.debug("Loading person list panel."); | ||
PersonListPanel personListPanel = | ||
UiPartLoader.loadUiPart(primaryStage, getPersonListPlaceholder(), new PersonListPanel()); | ||
personListPanel.configure(ui, modelManager, modelManager.getAllViewablePersonsReadOnly()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be even neater if we can combine the above two lines to a static method like this:
return PersonListPanel.load(primaryStage, getPersonListPlaceholder(), ui, modelManager);
That way, we can move the entire construction logic inside the respective UiPart class.
Instead of the UI part having reference to both objects, I was thinking more along this line:
The dialog here thus:
This might be better, and we can abstract away methods such as EDIT: Removed the |
try { | ||
logger.info("Starting main UI."); | ||
|
||
mainWindow = MainWindow.load(primaryStage, config, prefs, mainApp, this, modelManager); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the construction logic completely from the call site and put it in the respective class. This is an example of the clean call site.
Experimental restructuring of UI.
Objectives:
Controller
to refer to the class that represents a part of the UIUiPartLoader
Just wanted to see if this is viable.
I think I broke a few tests in the process (had to move fast).