-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversion of Preferences/TableColumnsTab to mvvm #5185
Conversion of Preferences/TableColumnsTab to mvvm #5185
Conversation
I generally like the checkedListView approach, but I am not sure if we need all the file type columns. Maybe one generic (not sure if this is possible with our architecture) Second, as we can reorder the columns in the maintable, it would be even better to add a righ click option there to add new columns instead of the preferences. |
I agree, adding and removing columns by a ContextMenu is probably more intuitive, and I must confess, I do not dislike this idea. One could also change the title or the type of the column by doubleclicking it or by dropdownMenu inside the ColumnTitle or something like that... I put the ExtraFileColumns in the CheckListView, to simplify the layout of the tab, as I found it very confusing with multiple listviews etc., because basically every single option (besides the radiobuttons) is creating a column in the maintable. So I think, the PrefsTab should reflect that. I wanted to change the checkboxes to simply enable the SpecialFields and FileFields as possible checkable options in the checkListView. About the ExtraFileColums: i was wondering myself, why there are distinct columns for every single ExternalFileType, as there is already a column, that does what you described, called the fileColumn. If only one file is attached, it displays a symbol of that type, if multiple files are attached, a generic symbol. By rightclicking that symbol, you can access the attached files. So I was not sure, if those multiple ExtraFileColumns are there as an artifact of an older JabRefVersion, or an enhancement, I did not yet understand, or just some silly idea of earlier days. 😉 This ExtraFileColumsLogic can probably be removed, as they are superceeded by the single fileColumn, can't it? Opinions? |
Yep this is also an idea I had an mind.
I would remove it and just keep the generic file column Renaming columns is a bit problematic I think, as they are bound to the field constants. For the moment I would really say go with the single checked list view. We can then further discuss how to proceed with the maintable option contextmenu. |
…tablecolumns # Conflicts: # src/main/java/org/jabref/gui/preferences/PreferencesDialogViewModel.java
eace48d
to
79ff2f6
Compare
This is driving me mad. I'm debugging this for hours.
@JabRef/developers Suggestions? Ideas? If it's ok for you, im going to delete the extraFileColumns as @Siedlerchr suggested... |
Ad 1: I managed to locate the problem to the ChangeListener in PersistentVisualState of the MainTable. It somehow rewrites the preferences everytime a value is changed, so every change made in the preferences is rewritten, as soon as the columns of the MainTable are changed in the same session with the old values. My question is: As this is not directly a problem of the preferencesTab, but of the mainTable, should I go deep into it, fixing it (which would require some larger refactoring of the MainTable and the PersistentVisualState, or should I leave it, create in issue and concentrate on the other PreferencesTabs? |
Another solution would be to remove the up/down buttons in the preferences dialog and let the mainTable itself handle resizing and rearranging the columns (which it already does fine). This could be an early, workable and mergable solution. Someone could still add this functionality later, and I could move on to the next tab... edit: Another possibility would be to forget about the whole CheckListView and to use a TableView with the name and a delete icon in the rows and a ComboBox to add items below like in the xmp-tab. This would of course not solve the first problem. |
I thought a while about the CheckListView. ControlsFX is somewhat nice, but it acutally causes more problems, than it solves. I'm going to change that to a tableView similiar to the XmpPrefsTab. But not today. 😄 |
Sorry for the late answer, was hiking the last few weeks. First of all thanks a lot for the work you put into the conversation of the preference tabs. Much appreciated. The table columns tab is a huge mess and your changes are a huge improvement. I think there are a few things that can still be improved:
|
No problem, there is no hurry - summertime is vacation time. |
Issue seems to exist already: #5164 |
…lixtus/jabref into preferences_mvvm_tablecolumns
src/main/java/org/jabref/gui/preferences/TableColumnsTabView.java
Outdated
Show resolved
Hide resolved
|
||
public BooleanProperty extraFileColumnsEnabledProperty() { return this.extraFileColumnsEnabledProperty; } | ||
|
||
public class ExtraFileField implements Field { |
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 would actually move this class to a new file and put it next to the other Fields.
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 am somewhat unsure about this. As this is just a wrapper class for the TableRowModel in the columnsList to draw the ExtraFileFieldColumns, I dont think it belongs into the model of Jabref. We already talked about removing these ExtraFileColumns completly, but after the discussion in #5244 I am very careful about removing any functionality...
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 created a util-class to store the ExtraFilePseudoField-class and a helper method which is going to be used also in PR #5265 . I hope this is a usable compromise.
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.
overal looks good to me, just two minor things
Codecov Report
@@ Coverage Diff @@
## master #5185 +/- ##
=========================================
Coverage ? 37.32%
Complexity ? 6114
=========================================
Files ? 1053
Lines ? 45830
Branches ? 5606
=========================================
Hits ? 17106
Misses ? 27401
Partials ? 1323
Continue to review full report at Codecov.
|
…tablecolumns # Conflicts: # src/main/java/org/jabref/gui/util/FieldsUtil.java # src/main/resources/l10n/JabRef_en.properties
((TableColumnsTabViewModel) viewModel).removeColumn(columnsList.getFocusModel().getFocusedItem())) | ||
.install(actionsColumn); | ||
|
||
((TableColumnsTabViewModel) viewModel).selectedColumnModelProperty().setValue(columnsList.getSelectionModel()); |
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.
For the next PR: you can get rid off these castings as follows:
- Add a generic type argument:
AbstractPreferenceTabView<T extends PreferenceTabViewModel>
- Change the variable to
protected T viewModel;
- Change declaration to
TableColumnsTabView extends AbstractPreferenceTabView<TableColumnsTabViewModel>
The code looks good to me and the UI is definitely a huge improvement already. Thus I'll merge now. It would be nice however if the changes proposed in #5185 (comment) are not forgotten ;-) Moreover, #5185 (comment) should give you few more minutes away from thesis ;-) |
follow up to #5033 , concerns #4927 #3416
fixes #5164 #4752 #3354 #4459
This is going to be a huge one. I already put some work into, but I need to take a little break, So I present an early WIP of the reworked TableColumsTab in the Preferences. There are some issues in sight, eg. the checkModel is sime kind of special.
I realized, there is maybe something wrong with the serializeSpecialFields-Option. I was not able to find any use for this pref in the whole code.
Im trying not to break anything, so besides the conversion I will not change the logic of what is controlled here. I'll leave that to another person, after im done here. My goal is to include all the specialFields and the FileFields in the
CheckListView, where you can sort, activate, deactivate, add custom fields (so called 'UnknownField') and remove them as you like.Feel free to comment on it, give suggestions and ideas.
Update: We did some conceptual changes. See below.