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
UI tab menu implementation & Refactoring #65
Conversation
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.
LGTM 👍
LGTM |
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.
LGTM! Can refactor/beautify a little bit after merge
protected void updateItem(Tab tab, boolean empty) { | ||
super.updateItem(tab, empty); | ||
if (empty || tab == null || tab.getName() == null) { | ||
setText(null); | ||
} else { | ||
setText(tab.getName()); | ||
} |
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.
Looks good! Maybe rename boolean empty to isEmpty to emphasize that it's a boolean :) You can consider having another method isEmpty that checks the condition in line 32 to adhere to the SLAP principle
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.
Thanks for reminding me the SLAP again. Will update the parameter name to isEmpty instead. For the isEmpty() method, the super method force to set it empty and update the list cell object so I don't think it is necessary. Anyway, thanks for the review.
from Cell.java
* @param item The new item for the cell.
* @param empty whether or not this cell represents data from the list. If it
* is empty, then it does not represent any domain data, but is a cell
* being used to render an "empty" row.
*/
protected void updateItem(T item, boolean empty) {
setItem(item);
setEmpty(empty);
if (empty && isSelected()) {
updateSelected(false);
}
}
for editing/adding menus in the tab panel, as of now, add a tab object in the tabMenus.json
ex)