Revision: 3573
Author: [email protected]
Date: Mon May 31 10:58:46 2010
Log: Now limiting the number of conflict reasons that can be displayed in
one conflicting update. Previously the list could reach
a large enough number the ok button of the dialog was off the screen.
http://code.google.com/p/power-architect/source/detail?r=3573
Modified:
/trunk/src/main/java/ca/sqlpower/architect/enterprise/NetworkConflictResolver.java
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/enterprise/NetworkConflictResolver.java
Thu May 27 15:14:51 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/enterprise/NetworkConflictResolver.java
Mon May 31 10:58:46 2010
@@ -67,6 +67,14 @@
public class NetworkConflictResolver extends Thread implements
MessageSender<JSONObject> {
+ /**
+ * If conflicts are found when trying to decide if an incoming change
+ * conflicts with the last user change only this many conflicting
properties
+ * or reasons will be displayed at max to prevent the dialog from
growing
+ * too large.
+ */
+ private static final int MAX_CONFLICTS_TO_DISPLAY = 10;
+
private static final Logger logger =
Logger.getLogger(NetworkConflictResolver.class);
private AtomicBoolean postingJSON = new AtomicBoolean(false);
private boolean updating = false;
@@ -245,8 +253,8 @@
} else {
String message = "";
message += "Your changes have been discarded due to a
conflict between you and another user: \n";
- for (ConflictMessage conflict : conflicts) {
- message += conflict.getMessage() + "\n";
+ for (int i = 0; i < MAX_CONFLICTS_TO_DISPLAY && i <
conflicts.size(); i++) {
+ message += conflicts.get(i).getMessage() + "\n";
}
session.createUserPrompter(message,
UserPromptType.MESSAGE,