-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Tooltip on crossref field. Improve display of groups.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.layout.HBox?> | ||
<?import org.jabref.gui.util.component.TagBar?> | ||
<?import com.jfoenix.controls.JFXChipView?> | ||
<fx:root xmlns:fx="http://javafx.com/fxml/1" type="HBox" xmlns="http://javafx.com/javafx/8.0.112" | ||
fx:controller="org.jabref.gui.fieldeditors.LinkedEntriesEditor"> | ||
<TagBar fx:id="linkedEntriesBar" maxWidth="Infinity" HBox.hgrow="ALWAYS"/> | ||
<JFXChipView fx:id="chipView" HBox.hgrow="ALWAYS" maxWidth="Infinity"/> | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tobiasdiez
|
||
</fx:root> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
package org.jabref.gui.fieldeditors; | ||
|
||
import com.jfoenix.controls.JFXChip; | ||
import com.jfoenix.controls.JFXChipView; | ||
import com.jfoenix.controls.JFXDefaultChip; | ||
import javafx.beans.binding.Bindings; | ||
import javafx.fxml.FXML; | ||
import javafx.scene.Parent; | ||
import javafx.scene.layout.HBox; | ||
|
||
import org.jabref.gui.autocompleter.AutoCompleteSuggestionProvider; | ||
import org.jabref.gui.autocompleter.AutoCompletionTextInputBinding; | ||
import org.jabref.gui.util.component.TagBar; | ||
import org.jabref.logic.integrity.FieldCheckers; | ||
import org.jabref.model.database.BibDatabaseContext; | ||
import org.jabref.model.entry.BibEntry; | ||
|
@@ -21,7 +22,7 @@ public class LinkedEntriesEditor extends HBox implements FieldEditorFX { | |
@FXML | ||
private final LinkedEntriesEditorViewModel viewModel; | ||
@FXML | ||
private TagBar<ParsedEntryLink> linkedEntriesBar; | ||
private JFXChipView<ParsedEntryLink> chipView; | ||
|
||
public LinkedEntriesEditor(Field field, BibDatabaseContext databaseContext, AutoCompleteSuggestionProvider<?> suggestionProvider, FieldCheckers fieldCheckers) { | ||
this.viewModel = new LinkedEntriesEditorViewModel(field, suggestionProvider, databaseContext, fieldCheckers); | ||
|
@@ -30,12 +31,18 @@ public LinkedEntriesEditor(Field field, BibDatabaseContext databaseContext, Auto | |
.root(this) | ||
.load(); | ||
|
||
linkedEntriesBar.setFieldProperties(field.getProperties()); | ||
linkedEntriesBar.setStringConverter(viewModel.getStringConverter()); | ||
linkedEntriesBar.setOnTagClicked((parsedEntryLink, mouseEvent) -> viewModel.jumpToEntry(parsedEntryLink)); | ||
// chipView.getSuggestions().addAll(viewModel.linkedEntriesProperty()); | ||
This comment has been minimized.
Sorry, something went wrong.
dextep
Author
Owner
|
||
|
||
AutoCompletionTextInputBinding.autoComplete(linkedEntriesBar.getInputTextField(), viewModel::complete, viewModel.getStringConverter()); | ||
Bindings.bindContentBidirectional(linkedEntriesBar.tagsProperty(), viewModel.linkedEntriesProperty()); | ||
chipView.setConverter(viewModel.getStringConverter()); | ||
|
||
chipView.setChipFactory( | ||
(view, item) -> { | ||
JFXChip<ParsedEntryLink> chip = new JFXDefaultChip<>(view, item); | ||
chip.setOnMouseClicked(event -> viewModel.jumpToEntry(item) ); | ||
return chip; | ||
}); | ||
|
||
Bindings.bindContentBidirectional(chipView.getChips(), viewModel.linkedEntriesProperty()); | ||
} | ||
|
||
public LinkedEntriesEditorViewModel getViewModel() { | ||
|
How can i set height, because maxHeight doesn't work? @tobiasdiez