Skip to content

Commit

Permalink
change default order for maintable
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgeiger committed Dec 14, 2015
1 parent 664c8fa commit e846c55
Showing 1 changed file with 31 additions and 28 deletions.
59 changes: 31 additions & 28 deletions src/main/java/net/sf/jabref/gui/maintable/MainTableFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,37 @@ public void updateTableFormat() {
// Add numbering column to tableColumns
tableColumns.add(SpecialMainTableColumns.NUMBER_COL);

// Add all file based columns
if (Globals.prefs.getBoolean(JabRefPreferences.FILE_COLUMN)) {
tableColumns.add(SpecialMainTableColumns.FILE_COLUMN);
}

if (Globals.prefs.getBoolean(JabRefPreferences.URL_COLUMN)) {
if (Globals.prefs.getBoolean(JabRefPreferences.PREFER_URL_DOI)) {
tableColumns.add(SpecialMainTableColumns
.createIconColumn(JabRefPreferences.URL_COLUMN, MainTableFormat.DOI_FIRST,
new JLabel(IconTheme.JabRefIcon.DOI.getSmallIcon())));
} else {
tableColumns.add(SpecialMainTableColumns
.createIconColumn(JabRefPreferences.URL_COLUMN, MainTableFormat.URL_FIRST,
new JLabel(IconTheme.JabRefIcon.WWW.getSmallIcon())));
}

}

if (Globals.prefs.getBoolean(JabRefPreferences.ARXIV_COLUMN)) {
tableColumns.add(SpecialMainTableColumns
.createIconColumn(JabRefPreferences.ARXIV_COLUMN, MainTableFormat.ARXIV,
new JLabel(IconTheme.JabRefIcon.WWW.getSmallIcon())));
}

if (Globals.prefs.getBoolean(JabRefPreferences.EXTRA_FILE_COLUMNS)) {
String[] desiredColumns = Globals.prefs.getStringArray(JabRefPreferences.LIST_OF_FILE_COLUMNS);
for (String desiredColumn : desiredColumns) {
tableColumns.add(SpecialMainTableColumns.createFileIconColumn(desiredColumn));
}
}

// Add 'normal' bibtex fields as configured in the preferences
// Read table columns from prefs:
String[] colSettings = Globals.prefs.getStringArray(JabRefPreferences.COLUMN_NAMES);
Expand Down Expand Up @@ -137,35 +168,7 @@ public void updateTableFormat() {
}
}

if (Globals.prefs.getBoolean(JabRefPreferences.FILE_COLUMN)) {
tableColumns.add(SpecialMainTableColumns.FILE_COLUMN);
}

if (Globals.prefs.getBoolean(JabRefPreferences.URL_COLUMN)) {
if (Globals.prefs.getBoolean(JabRefPreferences.PREFER_URL_DOI)) {
tableColumns.add(SpecialMainTableColumns
.createIconColumn(JabRefPreferences.URL_COLUMN, MainTableFormat.DOI_FIRST,
new JLabel(IconTheme.JabRefIcon.DOI.getSmallIcon())));
} else {
tableColumns.add(SpecialMainTableColumns
.createIconColumn(JabRefPreferences.URL_COLUMN, MainTableFormat.URL_FIRST,
new JLabel(IconTheme.JabRefIcon.WWW.getSmallIcon())));
}

}

if (Globals.prefs.getBoolean(JabRefPreferences.ARXIV_COLUMN)) {
tableColumns.add(SpecialMainTableColumns
.createIconColumn(JabRefPreferences.ARXIV_COLUMN, MainTableFormat.ARXIV,
new JLabel(IconTheme.JabRefIcon.WWW.getSmallIcon())));
}

if (Globals.prefs.getBoolean(JabRefPreferences.EXTRA_FILE_COLUMNS)) {
String[] desiredColumns = Globals.prefs.getStringArray(JabRefPreferences.LIST_OF_FILE_COLUMNS);
for (String desiredColumn : desiredColumns) {
tableColumns.add(SpecialMainTableColumns.createFileIconColumn(desiredColumn));
}
}
}

}

0 comments on commit e846c55

Please sign in to comment.