Make wrap fields also visible in entry editor#6315
Conversation
tobiasdiez
left a comment
There was a problem hiding this comment.
It's indeed a bit hacky. I like your idea to make this configurable since this is only one instance where people add a new field and require a certain type of action (e.g. what if I add a new "persons" field, or a new "keywords" field?). Thus having an option to specify the type of a field would be good.
* upstream/master: Update label names Squashed 'src/main/resources/csl-locales/' changes from d0ee4d13c9..79845b087b Squashed 'src/main/resources/csl-styles/' changes from c1793d2..143464e Cite work by @ayaankazerouni Improve performance for loading files (#6332) Add ADR von JUnit vs. AssertJ (#6335) 'Name' textfield on focus instead of 'OK' button when user clicks on 'Add subgroup' option (#6330) Bump jurt from 6.3.2 to 6.4.3 (#6325) Bump unoil from 6.3.2 to 6.4.3 (#6320) Bump ridl from 6.3.2 to 6.4.3 (#6326) Bump classgraph from 4.8.69 to 4.8.71 (#6322) Bump flexmark from 0.61.6 to 0.61.16 (#6318) Bump richtextfx from 0.10.4 to 0.10.5 (#6319) Bump guava from 28.2-jre to 29.0-jre (#6323) Bump flexmark-ext-gfm-tasklist from 0.61.6 to 0.61.16 (#6327) Bump org.beryx.jlink from 2.17.5 to 2.17.7 (#6324) Improve performance massively by fixing a stupid binding mistake (#6316) Fixed missing paste command (#6313) Remove cache of auto completion results (#6310)
|
I would leave a proper implementation for the future. This depends also a bit on #6152 |
koppor
left a comment
There was a problem hiding this comment.
Since this fixes an issue, we really need a CHANGELOG.md entry.
| preferences.getBoolean(JabRefPreferences.ALLOW_INTEGER_EDITION_BIBTEX)); | ||
|
|
||
| final boolean isSingleLine = FieldFactory.isSingleLineField(field); | ||
| boolean isMultiLine = FieldFactory.isMultiLineField(field, preferences.getFieldContentParserPreferences().getNonWrappableFields()); |
There was a problem hiding this comment.
Can we use an enum here? I really don't like the booleans - and we see changing the flag from singleLine to multiLine was necessary of readability. (Otherweise, the variable would be kept to flag singleLine - and negation would be used)
I propose to use a boolean enum as proposed at https://stackoverflow.com/a/12713550/873282
enum USED_LINES {
MULTI(true), SINGLE(false);
...Maybe, just a simple enum would also be OK. Then, the construction from boolean would be a bit more tricky though.
There was a problem hiding this comment.
If you want to go in this direction, an enum FieldType with Text and TextLong would make the most sense and conveys the semantics. Can then be extended in the future to include Keywords, Numeric etc.
There was a problem hiding this comment.
I really would like to leave it for the moment and implement a more generic solution in a follow up PR. I think about integrating it in the custom entry types dialog.
| textInput = isSingleLine | ||
| ? new EditorTextField() | ||
| : new EditorTextArea(); | ||
| textInput = isMultiLine ? new EditorTextArea() : new EditorTextField(); |
There was a problem hiding this comment.
Not that the true/false branches were just be wrapped. Another indicator for an enum!
|
Ping. |
|
I m merge this now and will work on a more clean solution |
…ptyLib * upstream/master: (23 commits) Make wrap fields also visible in entry editor (#6315) Add launcher to fix extension import in snap (#6439) add concise message when SaveException happen (#6444) Squashed 'src/main/resources/csl-locales/' changes from 79845b087b..cbb45961b8 Squashed 'src/main/resources/csl-styles/' changes from 906cd6d..270cd32 Addition to the early pull #6438 (#6441) Fix the bug #6421 (#6438) Cleanup dead code (#6436) Fixed entry duplication on file download (#6437) Add workaround for buildSrc issue (#6433) Remove dash from illegal characters. (#6300) Docs: For developers: New architectural decision added to list (#6397) Added a download checkbox to the import dialog (#6381) Bump jaxb-xjc from 2.3.2 to 2.3.3 (#6410) Bump flexmark-ext-gfm-strikethrough from 0.61.20 to 0.61.24 (#6413) Bump byte-buddy-parent from 1.10.9 to 1.10.10 (#6408) Bump flexmark-ext-gfm-tasklist from 0.61.20 to 0.61.24 (#6412) Bump org.beryx.jlink from 2.17.8 to 2.18.0 (#6411) Bump tika-core from 1.24 to 1.24.1 (#6409) Bump flexmark from 0.61.20 to 0.61.24 (#6416) ...
Fixes #4373
I simple reused the FieldFormatterPreferences wrapFieldList. More like a hack.
The original multiline property got removed in #5230
A more elegant solution would be to maybe add this to the custom entry types dialog?