Skip to content
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

Increase relative size of abstract field in editor #3320

Merged
merged 4 commits into from
Oct 19, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Updated French translation
- We improved the handling of abstracts in the "Astrophysics Data System" fetcher. [#2471](https://github.com/JabRef/jabref/issues/2471)
- We added support for pasting entries in different formats [#3143](https://github.com/JabRef/jabref/issues/3143)
- We increased the relative size of the "abstract" field in the entry editor. [Feature request in the forum](http://discourse.jabref.org/t/entry-preview-in-version-4/827)
- Crossreferenced entries are now used when a BibTex key is generated for an entry with empty fields. [#2811](https://github.com/JabRef/jabref/issues/2811)
- We now set the WM_CLASS of the UI to org-jabref-JabRefMain to allow certain Un*x window managers to properly identify its windows
- We changed the default paths for the OpenOffice/LibreOffice binaries to the default path for LibreOffice
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jabref/gui/fieldeditors/FieldEditors.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public static FieldEditorFX getForField(String fieldName, TaskExecutor taskExecu
return new PersonsEditor(fieldName, suggestionProvider, preferences, fieldCheckers);
} else if (FieldName.KEYWORDS.equals(fieldName)) {
return new KeywordsEditor(fieldName, suggestionProvider, fieldCheckers, preferences);
} else if (fieldExtras.contains(FieldProperty.MULTILINE_TEXT)) {
return new MultilineEditor(fieldName, suggestionProvider, fieldCheckers, preferences);
}

// default
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/org/jabref/gui/fieldeditors/MultilineEditor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.jabref.gui.fieldeditors;

import org.jabref.gui.autocompleter.AutoCompleteSuggestionProvider;
import org.jabref.logic.integrity.FieldCheckers;
import org.jabref.preferences.JabRefPreferences;

public class MultilineEditor extends SimpleEditor implements FieldEditorFX {

public MultilineEditor(String fieldName, AutoCompleteSuggestionProvider<?> suggestionProvider, FieldCheckers fieldCheckers, JabRefPreferences preferences) {
super (fieldName, suggestionProvider, fieldCheckers, preferences);
}

@Override
public double getWeight() {
return 4;
}
}
5 changes: 5 additions & 0 deletions src/main/java/org/jabref/model/entry/BibtexSingleField.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ public void setExtras(Set<FieldProperty> pExtras) {
properties = pExtras;
}

public BibtexSingleField withExtras(Set<FieldProperty> pExtras) {
properties = pExtras;
return this;
}

// fieldExtras contains mappings to tell the EntryEditor to add a specific
// function to this field, for instance a "browse" button for the "pdf" field.
public Set<FieldProperty> getFieldProperties() {
Expand Down
9 changes: 2 additions & 7 deletions src/main/java/org/jabref/model/entry/FieldProperty.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package org.jabref.model.entry;

import java.util.EnumSet;
import java.util.Set;

public enum FieldProperty {
YES_NO,
DATE,
Expand All @@ -28,8 +25,6 @@ public enum FieldProperty {
SINGLE_ENTRY_LINK,
MULTIPLE_ENTRY_LINK,
PUBLICATION_STATE,
VERBATIM;

public static final Set<FieldProperty> ALL_OPTS = EnumSet.allOf(FieldProperty.class);

MULTILINE_TEXT,
VERBATIM
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private InternalBibtexFields(String timeStampFieldName) {

// additional fields ------------------------------------------------------
add(new BibtexSingleField(FieldName.LOCATION, false));
add(new BibtexSingleField(FieldName.ABSTRACT, false, BibtexSingleField.LARGE_W, 400));
add(new BibtexSingleField(FieldName.ABSTRACT, false, BibtexSingleField.LARGE_W, 400).withExtras(EnumSet.of(FieldProperty.MULTILINE_TEXT)));

dummy = new BibtexSingleField(FieldName.URL, false, BibtexSingleField.SMALL_W);
dummy.setExtras(EnumSet.of(FieldProperty.EXTERNAL, FieldProperty.VERBATIM));
Expand Down