Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2016-12-07 14:19:35 +0000
committerGerrit Code Review @ Eclipse.org2016-12-09 19:59:51 +0000
commit42d829855ddfe45d7550d8b739c8a5ac2f1cc289 (patch)
treec62d4d52b392230eb2b0a52a2d2d9d143cbcc004 /plugins/infra
parentcf023359f527ca5b1d89a31d9152afca1306e3b8 (diff)
downloadorg.eclipse.papyrus-42d829855ddfe45d7550d8b739c8a5ac2f1cc289.tar.gz
org.eclipse.papyrus-42d829855ddfe45d7550d8b739c8a5ac2f1cc289.tar.xz
org.eclipse.papyrus-42d829855ddfe45d7550d8b739c8a5ac2f1cc289.zip
Bug 502559: [Table] Improve performances of nested filtering
https://bugs.eclipse.org/bugs/show_bug.cgi?id=502559 - Revert the refresh modifications in FilterRowDataProvider - Manage a copy of the list of filtered elements instead of the list in parameter (which have not to be modified) - This commit fix the JUnit test failure Change-Id: Ife589d3cb6e32ec1c85083a632e261f52ee12d79 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
Diffstat (limited to 'plugins/infra')
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/FilterRowDataProvider.java6
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/filter/PapyrusFilterStrategy.java10
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/filter/StringMatcherEditorFactory.java4
3 files changed, 10 insertions, 10 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/FilterRowDataProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/FilterRowDataProvider.java
index aea60457151..45f9c7823e2 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/FilterRowDataProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/dataprovider/FilterRowDataProvider.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Original authors and others - initial API and implementation
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 502559
******************************************************************************/
package org.eclipse.papyrus.infra.nattable.dataprovider;
@@ -303,8 +304,7 @@ public class FilterRowDataProvider<T> implements IDataProvider /* , IPersistable
if (isFilterRefreshing.compareAndSet(false, true)) {
filterStrategy.applyFilter(filterIndexToObjectMap);
columnHeaderLayer.fireLayerEvent(new FilterAppliedEvent(columnHeaderLayer));
- // Bug 502559: Remove the filtering refresh to false because it is not
- // a filter strategy re-construction but only an update
+ isFilterRefreshing.set(false);
}
}
@@ -360,8 +360,6 @@ public class FilterRowDataProvider<T> implements IDataProvider /* , IPersistable
display.asyncExec(schedule);
}
}
-
- isFilterRefreshing.set(true);
}
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/filter/PapyrusFilterStrategy.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/filter/PapyrusFilterStrategy.java
index 9d942a12372..c951edef329 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/filter/PapyrusFilterStrategy.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/filter/PapyrusFilterStrategy.java
@@ -8,7 +8,7 @@
*
* Contributors:
* Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 502559
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@acea.fr - Bug 502559
*
*****************************************************************************/
@@ -16,6 +16,7 @@ package org.eclipse.papyrus.infra.nattable.filter;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -201,15 +202,16 @@ public class PapyrusFilterStrategy implements IFilterStrategy<Object>, IDisposab
// find the lock and the matcher to use, it depends on the table invert axis state
ReadWriteLock filterLock = getReadWriteLockToUse();
CompositeMatcherEditor<Object> matcherEditor = getMatcherEditorToUse();
+ Map<Integer, Object> copyOfFilterIndexToObjectMap = new HashMap<Integer, Object>(filterIndexToObjectMap);
// wait until all listeners had the chance to handle the clear event
try {
filterLock.writeLock().lock();
- clearMarcherEditors(matcherEditor, filterIndexToObjectMap);
+ clearMarcherEditors(matcherEditor, copyOfFilterIndexToObjectMap);
} finally {
filterLock.writeLock().unlock();
}
- if (filterIndexToObjectMap.isEmpty()) {
+ if (copyOfFilterIndexToObjectMap.isEmpty()) {
return;
}
@@ -217,7 +219,7 @@ public class PapyrusFilterStrategy implements IFilterStrategy<Object>, IDisposab
EventList<MatcherEditor<Object>> matcherEditors = new BasicEventList<MatcherEditor<Object>>();
NatTable natTable = (NatTable) this.manager.getAdapter(NatTable.class);
IConfigRegistry configRegistry = natTable.getConfigRegistry();
- for (Entry<Integer, Object> mapEntry : filterIndexToObjectMap.entrySet()) {
+ for (Entry<Integer, Object> mapEntry : copyOfFilterIndexToObjectMap.entrySet()) {
final Integer columnIndex = mapEntry.getKey();
final Object value = mapEntry.getValue();
StringBuilder configLabel = new StringBuilder(FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX);
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/filter/StringMatcherEditorFactory.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/filter/StringMatcherEditorFactory.java
index f4d6fc82af3..7a392b936e1 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/filter/StringMatcherEditorFactory.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/filter/StringMatcherEditorFactory.java
@@ -8,7 +8,7 @@
*
* Contributors:
* Vincent LORENZO (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 502559
+ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 502559
*
*****************************************************************************/
@@ -137,7 +137,7 @@ public class StringMatcherEditorFactory<T> implements IPapyrusMatcherEditorFacto
stringMatcherEditors.add(getTextMatcherEditor(columnIndex, papyrusTextMatchingMode, textMatchingMode, displayConverter, parseResult.getValueToMatch(), columnAccessor, configRegistry));
} else {
Object threshold = displayConverter.displayToCanonicalValue(parseResult.getValueToMatch());
- matcherEditors.add(getThresholdMatcherEditor(columnIndex, threshold, wantedValue, comparator, columnValueProvider, matchOperation, configRegistry));
+ stringMatcherEditors.add(getThresholdMatcherEditor(columnIndex, threshold, wantedValue, comparator, columnValueProvider, matchOperation, configRegistry));
}
}
}

Back to the top