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

Scrollbar invisible in Preferences -> BibTex Key Pattern (#4287) #4398

Merged
merged 7 commits into from
Oct 24, 2018
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.util.Collection;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.*;

import javafx.scene.Node;
import javafx.scene.control.Button;
Expand Down Expand Up @@ -81,11 +78,11 @@ private void buildGUI() {
gridPane.add(defaultPat, 2, rowIndex);
gridPane.add(button, 3, rowIndex);

Object[] entryTypes = EntryTypes.getAllValues(mode).toArray();
List<EntryType> entryTypes = new ArrayList<>(EntryTypes.getAllValues(mode));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already a collection, you can just loop through it, for (EntryType type : EntryTypes.getAllValues(mode)) {
Collection is the Interface for all lists/arrays etc . The rule of thumb is to (always) code against interfaces
https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html


columnIndex=1;
for(int i=0; i < entryTypes.length; i++){
EntryType type = (EntryType) entryTypes[i];
for(int i=0; i < entryTypes.size(); i++){
EntryType type = entryTypes.get(i);
Label label1 = new Label(type.getName());

TextField textField = new TextField();
Expand Down