-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorderable columns in maintable for groups, URI, file and eprint (#5544
) * Initial * Added combined identifier column * Removed superfluous properties * Added display names and refactored * Fixed persistent state * changelog * Added columns to available set * checkstyle * Fixed bug in persistent view * Refactored parse, rewording, cleanups * Removed TableColumnsItemModel, cleanups * Added migration and some minor tweaks * Removed superfluous method getHeaderLabel * Cleanups, seperating specialFieldsPreferences, added width-binding * Refactored according to remarks * Added Tests
- Loading branch information
1 parent
de4a1ae
commit d1484f8
Showing
20 changed files
with
691 additions
and
592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 15 additions & 6 deletions
21
src/main/java/org/jabref/gui/maintable/MainTableColumn.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
package org.jabref.gui.maintable; | ||
|
||
import javafx.beans.value.ObservableValue; | ||
import javafx.scene.control.TableColumn; | ||
|
||
abstract class MainTableColumn<T> extends TableColumn<BibEntryTableViewModel, T> { | ||
import org.jabref.gui.util.BindingsHelper; | ||
|
||
MainTableColumn(String text) { | ||
super(text); | ||
public class MainTableColumn<T> extends TableColumn<BibEntryTableViewModel, T> { | ||
|
||
setCellValueFactory(param -> getColumnValue(param.getValue())); | ||
private MainTableColumnModel model; | ||
|
||
public MainTableColumn(MainTableColumnModel model) { | ||
this.model = model; | ||
|
||
BindingsHelper.bindBidirectional( | ||
this.widthProperty(), | ||
model.widthProperty(), | ||
value -> this.setPrefWidth(model.widthProperty().getValue()), | ||
value -> model.widthProperty().setValue(this.getWidth())); | ||
} | ||
|
||
abstract ObservableValue<T> getColumnValue(BibEntryTableViewModel entry); | ||
public MainTableColumnModel getModel() { return model; } | ||
|
||
public String getDisplayName() { return model.getDisplayName(); } | ||
} |
Oops, something went wrong.