-
-
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
Field properties - future implementation #978
Comments
First of all I suggest to use Enums with EnumSets instead of the int-Flags: From my perspective I would be in favor of separating gui and logic, and not store the mainTable sizes in the internal fields. |
We want to get rid of these flags anyway. There is an issue around, but I cannot find it right now. Maybe @koppor can help. |
#650 ? Get rid of them totally? Not sure that I follow here, but wouldn't it make sense to keep all field-related information in one place? @Siedlerchr Maybe not the actual sizes, but the behavior of the field. To me it makes sense to keep all information/properties related to fields in a single place. EnumSet seems like what I was looking for. |
After reading up on biblatex a bit more there are special fields for sorting. Would it make sense to include that here as well? A field which if non-empty points to another field to be used for sorting? (With the Biblatex mapping set by default.) |
The argumentation is given at #850: |
On what feedback are we waiting here? |
Shouldn't |
@simonharrer : good question. I remove the tag. There is still some feedback related to the MainTable stuff required though. @koppor: maybe. The reason that it wasn't stated originally was e.g. numeric sorting. Either one use a separate flag for that or add it as a type. I would assume that there are some other properties which may be similar when considering e.g. checkers. An alternative would of course be to have a mutually exclusive type and then some properties field. |
Although currently none of us has time to work on it, I just wanted to reference the issue discussing the |
I recently had a look at this class and, although not perfect, the code is now in a reasonable good state. There is still some gui-related stuff hidden in this model class, which should be removed at some point, but I don't think we should keep an issue just for this. Thus closed... |
Based on some earlier discussions, e.g., JabRef#59 #967 JabRef#32 , it seems to make sense to redefine and restructure the properties of each field. At the moment it is handled by https://github.com/JabRef/jabref/blob/master/src/main/java/net/sf/jabref/gui/InternalBibtexFields.java and especially the class BibtexSingleField in that file.
Currently the following properties are defined:
final String name;
- the name of the fieldint flag
- a combination ofint length
- field length in characters(?)double weight
- weight factor used for relative row size in the entry editor columns(?)int editorType
- may be one ofString extras;
- Determines any extra component in the entry editor, currently one of:boolean numeric;
- true if the field is expected to be numeric and in that way one can sort based on thatMy idea is to extend this. Currently, there are quite a lot of different fields, especially in Biblatex that has the "same" properties. For example, there are about ten or so different fields with names defined and it would be much better if one could check
field.isNameField()
instead of comparing against all the possible field names (now, mainly author and editor is checked). This would be useful for e.g. the integrity checks. Similarly, it would make sense if the field knew how it should be sorted (e.g. the date field in biblatex could use a dedicated comparator). Also, some fields can only take on specific values, either from a list (like month or languague) or being a number, like year. From a layout perspective, it is discussed in #967 that different fields should have minimum/maximum sizes and that some benefit from resizing, some not. Add to that alignment and the size required in the entry editor.The purpose of this issue is to try to come up with a good redesign of BibtexSingleField. It appears to me as there are a few larger problems here:
To this end, I'd suggest the following fields:
String name
int flag
- as beforeint type
- Combination of the following constants (numerical value tbd, probably more are needed, the Biblatex manual decribes this pretty well)namelist
- for author names - gives the field editor button and triggers "correct" integrity checkerskeyword
- field editor, can be set for other fields as well (which some people appears to be using)journal
- journal list/abbreviationtitle
- integrity checkdate
- date picker, special sorter, integrity checkmonth
- month list, integrity check (number in Biblatex)integer
- numerical sorting, only numerical value(?) (used for e.g. year, maybe number and volume, some IEEE fields)pagerange
- integrity checkerfile
- file-field parsingyesno
- IEEE yes/nolanguage
- select among languages (is a list)pagination
- list of pagination alternativeseditortype
- list of editor type alternativestexcode
- probably warn if one runs latex to unicode conversion on this field...uri
- droptarget for URL, possibility to open URLdoi
- special handling and checkingowner
- set owner on double-clickcrossref
- must be a bibtexkeygender
- list of alternativesoptions
- key=value pairsrelated
- bibtexkeys (not what is sometimes discussed as "referenced by" etc)relatedtype
- list of options (see Biblatex documentation)Entry editor related
double weight
- as beforeMain table related
boolean resizable
int minimalSize
int maximalSize
LayoutFormatter layoutFormatter
- should a layoutformatter be used for the field and in that case which(?)boolean resolve
- should the field be resolved for strings(?)Comparator comparator
? or handle by type?int alignment
- one of left, right, center (are there use cases for center? Numbers should probably be right-aligned anyway)The text was updated successfully, but these errors were encountered: