don't show no files for empty change lists

IDEA-CR-5051
This commit is contained in:
Sergey Ignatov
2015-09-23 16:48:24 +03:00
parent 425de211bf
commit 60bccce0a6
2 changed files with 7 additions and 3 deletions
@@ -56,8 +56,10 @@ public class ChangesBrowserChangeListNode extends ChangesBrowserNode<ChangeList>
final String freezed = myClManager.isFreezed();
if (freezed != null) {
renderer.append(spaceAndThinSpace() + freezed, SimpleTextAttributes.GRAYED_ATTRIBUTES);
} else if (myClManager.isInUpdate()) {
renderer.append(", " + VcsBundle.message("changes.nodetitle.updating"), SimpleTextAttributes.GRAYED_ATTRIBUTES);
}
else if (myClManager.isInUpdate()) {
renderer.append((getCountText().isEmpty() ? spaceAndThinSpace() : ", ") + VcsBundle.message("changes.nodetitle.updating"),
SimpleTextAttributes.GRAYED_ATTRIBUTES);
}
if (! myChangeListRemoteState.getState()) {
renderer.append(spaceAndThinSpace());
@@ -210,9 +210,11 @@ public class ChangesBrowserNode<T> extends DefaultMutableTreeNode {
appendCount(renderer);
}
@NotNull
protected String getCountText() {
int count = getCount();
int dirCount = getDirectoryCount();
if (dirCount == 0 && count == 0) return "";
if (dirCount == 0) {
return spaceAndThinSpace() + VcsBundle.message("changes.nodetitle.changecount", count);
}
@@ -225,7 +227,7 @@ public class ChangesBrowserNode<T> extends DefaultMutableTreeNode {
}
protected void appendCount(final ColoredTreeCellRenderer renderer) {
final String countText = getCountText();
String countText = getCountText();
renderer.append(countText, SimpleTextAttributes.GRAYED_ATTRIBUTES);
}