Top Fields Constructors Methods
org.jabref.gui.groups

public Class GroupNodeViewModel

extends Object
Class Inheritance
Imports
java.util.List, .Objects, .Optional, java.util.stream.Collectors, javafx.beans.InvalidationListener, .WeakInvalidationListener, javafx.beans.binding.Bindings, .BooleanBinding, .IntegerBinding, javafx.beans.property.SimpleBooleanProperty, javafx.collections.FXCollections, .ListChangeListener, .ObservableList, javafx.scene.input.Dragboard, javafx.scene.paint.Color, org.jabref.gui.DragAndDropDataFormats, .StateManager, org.jabref.gui.icon.IconTheme, .JabRefIcon, org.jabref.gui.util.BackgroundTask, .CustomLocalDragboard, .DroppingMouseLocation, .TaskExecutor, .UiTaskExecutor, org.jabref.logic.groups.DefaultGroupsFactory, org.jabref.logic.layout.format.LatexToUnicodeFormatter, org.jabref.model.FieldChange, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, org.jabref.model.groups.AbstractGroup, .AllEntriesGroup, .AutomaticGroup, .AutomaticKeywordGroup, .AutomaticPersonsGroup, .ExplicitGroup, .GroupEntryChanger, .GroupTreeNode, .KeywordGroup, .LastNameGroup, .RegexKeywordGroup, .SearchGroup, .TexGroup, org.jabref.model.strings.StringUtil, org.jabref.preferences.PreferencesService, com.tobiasdiez.easybind.EasyBind, com.tobiasdiez.easybind.EasyObservableList

Field Summary

Modifier and TypeField and Description
private final BooleanBinding
private final BooleanBinding
private final ObservableList<GroupNodeViewModel>
private final BibDatabaseContext
private final String
private final ObservableList<BibEntry>
private final SimpleBooleanProperty
private final GroupTreeNode
private final SimpleBooleanProperty
private final boolean
private final CustomLocalDragboard
private final ObservableList<BibEntry>
private final InvalidationListener
private final PreferencesService
private final StateManager
private final TaskExecutor

Constructor Summary

AccessConstructor and Description
public
GroupNodeViewModel(BibDatabaseContext databaseContext, StateManager stateManager, TaskExecutor taskExecutor, GroupTreeNode groupNode, CustomLocalDragboard localDragBoard, PreferencesService preferencesService)

public
GroupNodeViewModel(BibDatabaseContext databaseContext, StateManager stateManager, TaskExecutor taskExecutor, AbstractGroup group, CustomLocalDragboard localDragboard, PreferencesService preferencesService)

Method Summary

Modifier and TypeMethod and Description
public boolean
acceptableDrop(Dragboard dragboard)

Decides if the content stored in the given Dragboard can be dropped on the given target row.

public List<FieldChange>
public GroupTreeNode
public BooleanBinding
public BooleanBinding
public boolean
public boolean
public boolean
public boolean
private JabRefIcon
public void
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public SimpleBooleanProperty
pack-priv static GroupNodeViewModel
getAllEntriesGroup(BibDatabaseContext newDatabase, StateManager stateManager, TaskExecutor taskExecutor, CustomLocalDragboard localDragBoard, PreferencesService preferencesService)

public Optional<GroupNodeViewModel>
getChildByPath(String pathToSource)

public ObservableList<GroupNodeViewModel>
public Color
public String
public String
public GroupTreeNode
public IntegerBinding
public JabRefIcon
public Optional<GroupTreeNode>
public String
private int
public SimpleBooleanProperty
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
public boolean
pack-priv boolean
isMatchedBy(String searchString)

public boolean
public void
public void
moveTo(GroupTreeNode target, int targetIndex)

private void
onDatabaseChanged(ListChangeListener.Change<? extends BibEntry> change)

Gets invoked if an entry in the current database changes.

private Optional<JabRefIcon>
parseIcon(String iconCode)

private void
pack-priv void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private GroupNodeViewModel
private void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

allSelectedEntriesMatchedback to summary
private final BooleanBinding allSelectedEntriesMatched
anySelectedEntriesMatchedback to summary
private final BooleanBinding anySelectedEntriesMatched
childrenback to summary
private final ObservableList<GroupNodeViewModel> children
databaseContextback to summary
private final BibDatabaseContext databaseContext
displayNameback to summary
private final String displayName
entriesListback to summary
private final ObservableList<BibEntry> entriesList
expandedPropertyback to summary
private final SimpleBooleanProperty expandedProperty
groupNodeback to summary
private final GroupTreeNode groupNode
hasChildrenback to summary
private final SimpleBooleanProperty hasChildren
isRootback to summary
private final boolean isRoot
localDragBoardback to summary
private final CustomLocalDragboard localDragBoard
matchedEntriesback to summary
private final ObservableList<BibEntry> matchedEntries
onInvalidatedGroupback to summary
private final InvalidationListener onInvalidatedGroup
preferencesServiceback to summary
private final PreferencesService preferencesService
stateManagerback to summary
private final StateManager stateManager
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

GroupNodeViewModelback to summary
public GroupNodeViewModel(BibDatabaseContext databaseContext, StateManager stateManager, TaskExecutor taskExecutor, GroupTreeNode groupNode, CustomLocalDragboard localDragBoard, PreferencesService preferencesService)
GroupNodeViewModelback to summary
public GroupNodeViewModel(BibDatabaseContext databaseContext, StateManager stateManager, TaskExecutor taskExecutor, AbstractGroup group, CustomLocalDragboard localDragboard, PreferencesService preferencesService)

Method Detail

acceptableDropback to summary
public boolean acceptableDrop(Dragboard dragboard)

Decides if the content stored in the given Dragboard can be dropped on the given target row. Currently, the following sources are allowed:

  • another group (will be added as subgroup on drop)
  • entries if the group implements GroupEntryChanger (will be assigned to group on drop)
addEntriesToGroupback to summary
public List<FieldChange> addEntriesToGroup(List<BibEntry> entries)
addSubgroupback to summary
public GroupTreeNode addSubgroup(AbstractGroup subgroup)
allSelectedEntriesMatchedPropertyback to summary
public BooleanBinding allSelectedEntriesMatchedProperty()
anySelectedEntriesMatchedPropertyback to summary
public BooleanBinding anySelectedEntriesMatchedProperty()
canAddEntriesInback to summary
public boolean canAddEntriesIn()
canAddGroupsInback to summary
public boolean canAddGroupsIn()
canBeDraggedback to summary
public boolean canBeDragged()
canRemoveback to summary
public boolean canRemove()
createDefaultIconback to summary
private JabRefIcon createDefaultIcon()
draggedOnback to summary
public void draggedOn(GroupNodeViewModel target, DroppingMouseLocation mouseLocation)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
expandedPropertyback to summary
public SimpleBooleanProperty expandedProperty()
getAllEntriesGroupback to summary
pack-priv static GroupNodeViewModel getAllEntriesGroup(BibDatabaseContext newDatabase, StateManager stateManager, TaskExecutor taskExecutor, CustomLocalDragboard localDragBoard, PreferencesService preferencesService)
getChildByPathback to summary
public Optional<GroupNodeViewModel> getChildByPath(String pathToSource)
getChildrenback to summary
public ObservableList<GroupNodeViewModel> getChildren()
getColorback to summary
public Color getColor()
getDescriptionback to summary
public String getDescription()
getDisplayNameback to summary
public String getDisplayName()
getGroupNodeback to summary
public GroupTreeNode getGroupNode()
getHitsback to summary
public IntegerBinding getHits()
getIconback to summary
public JabRefIcon getIcon()
getParentback to summary
public Optional<GroupTreeNode> getParent()
getPathback to summary
public String getPath()
getPositionInParentback to summary
private int getPositionInParent()
hasChildrenPropertyback to summary
public SimpleBooleanProperty hasChildrenProperty()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
hasSubgroupsback to summary
public boolean hasSubgroups()
isEditableback to summary
public boolean isEditable()
isMatchedByback to summary
pack-priv boolean isMatchedBy(String searchString)
isRootback to summary
public boolean isRoot()
moveToback to summary
public void moveTo(GroupNodeViewModel target)
moveToback to summary
public void moveTo(GroupTreeNode target, int targetIndex)
onDatabaseChangedback to summary
private void onDatabaseChanged(ListChangeListener.Change<? extends BibEntry> change)

Gets invoked if an entry in the current database changes.

parseIconback to summary
private Optional<JabRefIcon> parseIcon(String iconCode)
refreshGroupback to summary
private void refreshGroup()
toggleExpansionback to summary
pack-priv void toggleExpansion()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
toViewModelback to summary
private GroupNodeViewModel toViewModel(GroupTreeNode child)
updateMatchedEntriesback to summary
private void updateMatchedEntries()