Top Inners Fields Constructors Methods
org.jabref.gui.commonfxcontrols

public Class CitationKeyPatternsPanel

extends TableView<CitationKeyPatternsPanelItemModel>
Class Inheritance
Imports
java.util.Collection, javafx.beans.property.ListProperty, .ObjectProperty, javafx.fxml.FXML, javafx.scene.control.TableColumn, .TableRow, .TableView, javafx.scene.control.cell.TextFieldTableCell, javafx.scene.input.KeyEvent, org.jabref.gui.icon.IconTheme, org.jabref.gui.util.ValueTableCellFactory, org.jabref.logic.citationkeypattern.AbstractCitationKeyPatterns, org.jabref.logic.l10n.Localization, org.jabref.model.entry.BibEntryType, org.jabref.model.entry.types.EntryType, org.jabref.preferences.PreferencesService, com.airhacks.afterburner.views.ViewLoader, jakarta.inject.Inject

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
public TableColumn<CitationKeyPatternsPanelItemModel, EntryType>
public TableColumn<CitationKeyPatternsPanelItemModel, EntryType>
private long
public TableColumn<CitationKeyPatternsPanelItemModel, String>
private PreferencesService
private String
private CitationKeyPatternsPanelViewModel
Inherited from javafx.scene.control.TableView:
CONSTRAINED_RESIZE_POLICYCONSTRAINED_RESIZE_POLICY_ALL_COLUMNSCONSTRAINED_RESIZE_POLICY_FLEX_LAST_COLUMNCONSTRAINED_RESIZE_POLICY_FLEX_NEXT_COLUMNCONSTRAINED_RESIZE_POLICY_LAST_COLUMNCONSTRAINED_RESIZE_POLICY_NEXT_COLUMNCONSTRAINED_RESIZE_POLICY_SUBSEQUENT_COLUMNSDEFAULT_SORT_POLICYUNCONSTRAINED_RESIZE_POLICY

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ObjectProperty<CitationKeyPatternsPanelItemModel>
private void
private void
public ListProperty<CitationKeyPatternsPanelItemModel>
public void
public void
Inherited from javafx.scene.control.TableView:
columnResizePolicyPropertycomparatorPropertycreateDefaultSkinediteditablePropertyeditingCellPropertyfixedCellSizePropertyfocusModelPropertygetClassCssMetaDatagetColumnResizePolicygetColumnsgetComparatorgetControlCssMetaDatagetEditingCellgetFixedCellSizegetFocusModelgetItemsgetOnScrollTogetOnScrollToColumngetOnSortgetPlaceholdergetRowFactorygetSelectionModelgetSortOrdergetSortPolicygetVisibleLeafColumngetVisibleLeafColumnsgetVisibleLeafIndexisEditableisTableMenuButtonVisibleitemsPropertyonScrollToColumnPropertyonScrollToPropertyonSortPropertyplaceholderPropertyqueryAccessibleAttributerefreshresizeColumnrowFactoryPropertyscrollToscrollToscrollToColumnscrollToColumnIndexselectionModelPropertysetColumnResizePolicysetEditablesetFixedCellSizesetFocusModelsetItemssetOnScrollTosetOnScrollToColumnsetOnSortsetPlaceholdersetRowFactorysetSelectionModelsetSortPolicysetTableMenuButtonVisiblesortsortPolicyPropertytableMenuButtonVisibleProperty

Field Detail

actionsColumnback to summary
public TableColumn<CitationKeyPatternsPanelItemModel, EntryType> actionsColumn
Annotations
@FXML
entryTypeColumnback to summary
public TableColumn<CitationKeyPatternsPanelItemModel, EntryType> entryTypeColumn
Annotations
@FXML
lastKeyPressTimeback to summary
private long lastKeyPressTime
patternColumnback to summary
public TableColumn<CitationKeyPatternsPanelItemModel, String> patternColumn
Annotations
@FXML
preferencesback to summary
private PreferencesService preferences
Annotations
@Inject
tableSearchTermback to summary
private String tableSearchTerm
viewModelback to summary
private CitationKeyPatternsPanelViewModel viewModel

Constructor Detail

CitationKeyPatternsPanelback to summary
public CitationKeyPatternsPanel()

Method Detail

defaultKeyPatternPropertyback to summary
public ObjectProperty<CitationKeyPatternsPanelItemModel> defaultKeyPatternProperty()
initializeback to summary
private void initialize()
Annotations
@FXML
jumpToSearchKeyback to summary
private void jumpToSearchKey(KeyEvent keypressed)
patternListPropertyback to summary
public ListProperty<CitationKeyPatternsPanelItemModel> patternListProperty()
resetAllback to summary
public void resetAll()
setValuesback to summary
public void setValues(Collection<BibEntryType> entryTypeList, AbstractCitationKeyPatterns keyPattern)
org.jabref.gui.commonfxcontrols back to summary

private Class CitationKeyPatternsPanel.HighlightTableRow

extends TableRow<CitationKeyPatternsPanelItemModel>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
updateItem(CitationKeyPatternsPanelItemModel
The new item for the cell.
item
,
boolean
whether or not this cell represents data from the list. If it is empty, then it does not represent any domain data, but is a cell being used to render an "empty" row.
empty
)

Overrides javafx.scene.control.Cell.updateItem.

The updateItem method should not be called by developers, but it is the best method for developers to override to allow for them to customise the visuals of the cell.

Inherited from javafx.scene.control.TableRow:
createDefaultSkingetTableViewqueryAccessibleAttributetableViewPropertyupdateTableView

Constructor Detail

HighlightTableRowback to summary
private HighlightTableRow()

Method Detail

updateItemback to summary
public void updateItem(CitationKeyPatternsPanelItemModel item, boolean empty)

Overrides javafx.scene.control.Cell.updateItem.

Doc from javafx.scene.control.Cell.updateItem.

The updateItem method should not be called by developers, but it is the best method for developers to override to allow for them to customise the visuals of the cell. To clarify, developers should never call this method in their code (they should leave it up to the UI control, such as the javafx.scene.control.ListView control) to call this method. However, the purpose of having the updateItem method is so that developers, when specifying custom cell factories (again, like the ListView cell factory), the updateItem method can be overridden to allow for complete customisation of the cell.

It is very important that subclasses of Cell override the updateItem method properly, as failure to do so will lead to issues such as blank cells or cells with unexpected content appearing within them. Here is an example of how to properly override the updateItem method:

protected void updateItem(T item, boolean empty) {
    super.updateItem(item, empty);

    if (empty || item == null) {
        setText(null);
        setGraphic(null);
    } else {
        setText(item.toString());
    }
}

Note in this code sample two important points:

  1. We call the super.updateItem(T, boolean) method. If this is not done, the item and empty properties are not correctly set, and you are likely to end up with graphical issues.
  2. We test for the empty condition, and if true, we set the text and graphic properties to null. If we do not do this, it is almost guaranteed that end users will see graphical artifacts in cells unexpectedly.
Parameters
item:CitationKeyPatternsPanelItemModel

The new item for the cell.

empty:boolean

whether or not this cell represents data from the list. If it is empty, then it does not represent any domain data, but is a cell being used to render an "empty" row.

Annotations
@Override