mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-15 10:18:45 +00:00
bug5819: don't remove a report's queries when showing results of a report just loaded
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.dashboards.gwt"/> </runtimeClasspathEntry> "/>
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="com.sap.sailing.dashboards.gwt"/> </runtimeClasspathEntry> "/>
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
|
||||
+1
-1
@@ -312,7 +312,7 @@ public class DataMiningEntryPoint extends AbstractSailingReadEntryPoint implemen
|
||||
});
|
||||
// removing a tab from the result presenter shall remove its query from the current report
|
||||
resultsPresenter.addPresenterRemovedListener((String presenterId, int presenterIndex, StatisticQueryDefinitionDTO queryDefinition) -> {
|
||||
if (queryDefinition != null) {
|
||||
if (queryDefinition != null && currentReport != null && currentReport.getReport() != null) {
|
||||
currentReport.getReport().removeQueryDefinition(queryDefinition);
|
||||
}
|
||||
});
|
||||
|
||||
+22
-14
@@ -184,20 +184,22 @@ public class DataMiningReportStoreControls extends Composite {
|
||||
final DataMiningReportDTO report = storedReport.getReport();
|
||||
reportProvider.setCurrentReport(storedReport);
|
||||
final Iterable<StatisticQueryDefinitionDTO> reportQueries = report.getQueryDefinitions();
|
||||
final SequentialQueryExecutor executor = new SequentialQueryExecutor(reportQueries);
|
||||
executor.run(results -> {
|
||||
resultsPresenter.showResults(results);
|
||||
showBusyIndicator(false);
|
||||
if (!executor.hasErrorOccurred()) {
|
||||
Notification.notify(
|
||||
StringMessages.INSTANCE.dataMiningStoredReportLoadedSuccessful(storedReport.getName()),
|
||||
NotificationType.SUCCESS);
|
||||
} else {
|
||||
Notification.notify(
|
||||
StringMessages.INSTANCE.dataMiningStoredReportLoadedWithErrors(storedReport.getName()),
|
||||
NotificationType.WARNING);
|
||||
}
|
||||
});
|
||||
if (!Util.isEmpty(reportQueries)) {
|
||||
final SequentialQueryExecutor executor = new SequentialQueryExecutor(reportQueries);
|
||||
executor.run(results -> {
|
||||
resultsPresenter.showResults(results);
|
||||
showBusyIndicator(false);
|
||||
if (!executor.hasErrorOccurred()) {
|
||||
Notification.notify(
|
||||
StringMessages.INSTANCE.dataMiningStoredReportLoadedSuccessful(storedReport.getName()),
|
||||
NotificationType.SUCCESS);
|
||||
} else {
|
||||
Notification.notify(
|
||||
StringMessages.INSTANCE.dataMiningStoredReportLoadedWithErrors(storedReport.getName()),
|
||||
NotificationType.WARNING);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return storedReport;
|
||||
}
|
||||
@@ -226,7 +228,13 @@ public class DataMiningReportStoreControls extends Composite {
|
||||
private boolean errorOccurred = false;
|
||||
private Consumer<Collection<Pair<StatisticQueryDefinitionDTO, QueryResultDTO<?>>>> callback;
|
||||
|
||||
/**
|
||||
* @param queryDefinitions must contain at least one query
|
||||
*/
|
||||
public SequentialQueryExecutor(Iterable<StatisticQueryDefinitionDTO> queryDefinitions) {
|
||||
if (Util.isEmpty(queryDefinitions)) {
|
||||
throw new IllegalArgumentException("SequentialQueryExecutor expects at least one query");
|
||||
}
|
||||
this.queryDefinitions = new ArrayList<>();
|
||||
Util.addAll(queryDefinitions, this.queryDefinitions);
|
||||
}
|
||||
|
||||
+6
-1
@@ -99,7 +99,12 @@ public interface CompositeResultsPresenter<SettingsType extends Settings> extend
|
||||
|
||||
/**
|
||||
* Display the given query result pairs. Any results that are currently displayed will be overridden and additional
|
||||
* child presenters will be created if necessary.
|
||||
* child presenters will be created if necessary. No {@link CurrentPresenterChangedListener} or
|
||||
* {@link PresenterRemovedListener} registered through
|
||||
* {@link #addCurrentPresenterChangedListener(CurrentPresenterChangedListener)} and
|
||||
* {@link #addPresenterRemovedListener(PresenterRemovedListener)}, respectively, will be notified by calling this
|
||||
* method. It is assumed that the caller is entirely replacing all results at once and not incrementally
|
||||
* manipulating, e.g., a report.
|
||||
*
|
||||
* @param results
|
||||
* The query result pairs to display
|
||||
|
||||
+12
-3
@@ -162,8 +162,7 @@ public class TabbedResultsPresenter extends AbstractDataMiningComponent<Settings
|
||||
|
||||
@Override
|
||||
public void showResults(Iterable<Pair<StatisticQueryDefinitionDTO, QueryResultDTO<?>>> results) {
|
||||
// TODO bug4789: should we check for changes in the tabs before removing them?
|
||||
new ArrayList<>(tabsMappedById.keySet()).stream().map(tabsMappedById::get).forEach(this::removeTab);
|
||||
new ArrayList<>(tabsMappedById.keySet()).stream().map(tabsMappedById::get).forEach(this::removeTabNotNotifyingListeners);
|
||||
for (final Pair<StatisticQueryDefinitionDTO, QueryResultDTO<?>> entry : results) {
|
||||
final StatisticQueryDefinitionDTO queryDefinition = entry.getA();
|
||||
final QueryResultDTO<?> result = entry.getB();
|
||||
@@ -272,13 +271,23 @@ public class TabbedResultsPresenter extends AbstractDataMiningComponent<Settings
|
||||
tabPanel.scrollToTab(presenterIndex);
|
||||
return presenterTab;
|
||||
}
|
||||
|
||||
protected void removeTabNotNotifyingListeners(CloseablePresenterTab tab) {
|
||||
removeTab(tab, /* notifyListeners */ false);
|
||||
}
|
||||
|
||||
protected void removeTab(CloseablePresenterTab tab) {
|
||||
removeTab(tab, /* notifyListeners */ true);
|
||||
}
|
||||
|
||||
protected void removeTab(CloseablePresenterTab tab, boolean notifyListeners) {
|
||||
String presenterId = tab.getId();
|
||||
int index = getPresenterIndex(presenterId);
|
||||
tab.removeFromParent();
|
||||
tabsMappedById.remove(presenterId);
|
||||
this.presenterRemovedListeners.forEach(l -> l.onPresenterRemoved(presenterId, index, tab.getPresenter().getCurrentQueryDefinition()));
|
||||
if (notifyListeners) {
|
||||
this.presenterRemovedListeners.forEach(l -> l.onPresenterRemoved(presenterId, index, tab.getPresenter().getCurrentQueryDefinition()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sse.gwt" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sse.gwt/src" path="3" type="2"/> "/>
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.CONSIDER_INHERITED_MAIN" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.debug.ui.INCLUDE_EXTERNAL_JARS" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" javaProject="com.sap.sailing.gwt.ui" path="1" type="4"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/com.sap.sailing.gwt.ui/src/main/resources" path="3" type="2"/> "/>
|
||||
|
||||
Reference in New Issue
Block a user