Skip to content

Commit

Permalink
Fix #1434: Static groups are now longer displayed as dynamic ones
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Jun 5, 2016
1 parent a6769dd commit 39dc8d9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
### Fixed
- Fixed [#405](https://github.com/JabRef/jabref/issues/405): Added more {} around capital letters in Unicode/HTML to LaTeX conversion to preserve them
- Alleviate multiuser concurrency issue when near simultaneous saves occur to a shared database file

- Fixed [#1434](https://github.com/JabRef/jabref/issues/1434): Static groups are now longer displayed as dynamic ones

### Removed

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/sf/jabref/gui/groups/GroupDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public void actionPerformed(ActionEvent e) {
m_sgCaseSensitive.addItemListener(itemListener);

// configure for current type
if (editedGroup instanceof KeywordGroup) {
if (editedGroup.getClass() == KeywordGroup.class) {
KeywordGroup group = (KeywordGroup) editedGroup;
m_name.setText(group.getName());
m_kgSearchField.setText(group.getSearchField());
Expand All @@ -356,15 +356,15 @@ public void actionPerformed(ActionEvent e) {
m_kgRegExp.setSelected(group.isRegExp());
m_keywordsRadioButton.setSelected(true);
setContext(editedGroup.getHierarchicalContext());
} else if (editedGroup instanceof SearchGroup) {
} else if (editedGroup.getClass() == SearchGroup.class) {
SearchGroup group = (SearchGroup) editedGroup;
m_name.setText(group.getName());
m_sgSearchExpression.setText(group.getSearchExpression());
m_sgCaseSensitive.setSelected(group.isCaseSensitive());
m_sgRegExp.setSelected(group.isRegExp());
m_searchRadioButton.setSelected(true);
setContext(editedGroup.getHierarchicalContext());
} else if (editedGroup instanceof ExplicitGroup) {
} else if (editedGroup.getClass() == ExplicitGroup.class) {
m_name.setText(editedGroup.getName());
m_explicitRadioButton.setSelected(true);
setContext(editedGroup.getHierarchicalContext());
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/net/sf/jabref/logic/groups/ExplicitGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,9 @@ public String getTypeId() {
public int hashCode() {
return super.hashCode();
}

@Override
public boolean isDynamic() {
return false;
}
}
6 changes: 3 additions & 3 deletions src/main/java/net/sf/jabref/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public static boolean warnAssignmentSideEffects(AbstractGroup group, Component p
/**
* Warns the user of undesired side effects of an explicit assignment/removal of entries to/from this group.
* Currently there are four types of groups: AllEntriesGroup, SearchGroup - do not support explicit assignment.
* ExplicitGroup - never modifies entries. KeywordGroup - only this modifies entries upon assignment/removal.
* Modifications are acceptable unless they affect a standard field (such as "author") besides the "keywords" field.
* ExplicitGroup and KeywordGroup - this modifies entries upon assignment/removal.
* Modifications are acceptable unless they affect a standard field (such as "author") besides the "keywords" or "groups' field.
*
* @param parent The Component used as a parent when displaying a confirmation dialog.
* @return true if the assignment has no undesired side effects, or the user chose to perform it anyway. false
Expand All @@ -87,7 +87,7 @@ public static boolean warnAssignmentSideEffects(List<AbstractGroup> groups, Comp
if (group instanceof KeywordGroup) {
KeywordGroup kg = (KeywordGroup) group;
String field = kg.getSearchField().toLowerCase();
if ("keywords".equals(field)) {
if ("keywords".equals(field) || "groups".equals(field)) {
continue; // this is not undesired
}
int len = InternalBibtexFields.numberOfPublicFields();
Expand Down

0 comments on commit 39dc8d9

Please sign in to comment.