-
Notifications
You must be signed in to change notification settings - Fork 153
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.
Thanks, @jay4kelly! Bringing together all the code concerning those buttons helps a lot to have a tidy and well designed codebase. There's an issue about the use of extension in the new classes, though. Please, see my comments below.
src/org/opendatakit/briefcase/ui/reused/ExportConfigurationButton.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #845 +/- ##
=========================================
Coverage ? 48.29%
Complexity ? 1637
=========================================
Files ? 195
Lines ? 10360
Branches ? 747
=========================================
Hits ? 5003
Misses ? 5001
Partials ? 356
Continue to review full report at Codecov.
|
@ggalmazor Changed DetailStatusButton and ExportConfigurationButton to not extend JButton. Added ButtonProcessing Interface. Could have added a CommonButton class for the button classes to extend instead of using the interface. I think this would require us to remove the static create method on the button classes and use a new operator instead. |
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, @jay4kelly! I like how you decided to extract an interface to provide polymorphic access to the wrapped JButton
instance.
I think we should still fix a couple of things, though. Please, read my other comments.
if (value instanceof JButton) | ||
((JButton) value).doClick(); | ||
if (value instanceof ButtonProcessing) | ||
((ButtonProcessing) value).getJButton().doClick(); |
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.
Here I think I would expect not having to unwrap the JButton
object from the value
, as in ((ButtonProcessing) value).click();
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.
Tried that but the doClick call was required to be performed by a JButton class. We can recheck that if you think it should work.
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.
I was thinking about adding a ButtonProcessing.doClick
method that wraps button.doClick
, to avoid breaking encapsulation.
src/org/opendatakit/briefcase/ui/export/components/ExportFormsTableViewModel.java
Outdated
Show resolved
Hide resolved
src/org/opendatakit/briefcase/ui/export/components/ExportFormsTableViewModel.java
Show resolved
Hide resolved
src/org/opendatakit/briefcase/ui/reused/transfer/TransferFormsTableView.java
Show resolved
Hide resolved
src/org/opendatakit/briefcase/ui/reused/transfer/TransferFormsTableView.java
Show resolved
Hide resolved
src/org/opendatakit/briefcase/ui/export/components/ExportFormsTableView.java
Show resolved
Hide resolved
Hi, @jay4kelly! After exploring a bit more the changes I was suggesting, I've come to the conclusion that they don't bring that much value overall. This PR is looking good to me now :) Thanks for your work!! |
Closes #838 |
Tested with success! @opendatakit-bot unlabel "needs testing" |
…e and sorting behavior jay4kelly 12/3/19, 6:03 PM
…ill have a boolean comparator for the Select column.
…ge detail status button to not extend JButton
Simplified ButtonProcessing Interface Removed methods from UI class and made them part of the ButtonProcessing
Hi, @jay4kelly! I've rebased your branch on top of master to be able to merge it. Thanks for your work! |
Closes #838
What has been done to verify that this works as intended?
Tested using UI for all buttons and chevrons.
Why is this the best possible solution? Were any other approaches considered?
Created classes called DetailsStatusButton and ExportConfigurationButton. The selection column didn't need a class for it as there was no business logic incorporated. So we continued to use a compareSelectionfunction inside the UI class.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Localized just to the UI tests conducted.
Does this change require updates to documentation? If so, please file an issue at https://github.com/opendatakit/docs/issues/new and include the link below.
No