Commit fded2951 authored by Adrien's avatar Adrien

Do not update default queries when constraints are updated -> the

operation can be really expensive, it is not worth.
parent 3c9f5335
...@@ -48,6 +48,5 @@ public class ConstraintAttributeCheckListener implements ICheckStateListener { ...@@ -48,6 +48,5 @@ public class ConstraintAttributeCheckListener implements ICheckStateListener {
} }
selectedAttributeObservable.setValue(element); selectedAttributeObservable.setValue(element);
constraintViewer.refresh(selectedConstraintObservable.getValue()); constraintViewer.refresh(selectedConstraintObservable.getValue());
formPage.updateDefaultQueries();
} }
} }
...@@ -37,6 +37,7 @@ import org.eclipse.core.databinding.observable.value.IObservableValue; ...@@ -37,6 +37,7 @@ import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.e4.core.contexts.IEclipseContext; import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolBar;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
...@@ -136,10 +137,12 @@ public abstract class AbstractBdmFormPage extends AbstractFormPage<BusinessObjec ...@@ -136,10 +137,12 @@ public abstract class AbstractBdmFormPage extends AbstractFormPage<BusinessObjec
} }
public void updateDefaultQueries() { public void updateDefaultQueries() {
BusinessObject businessObject = observeBusinessObjectSelected().getValue(); Display.getDefault().asyncExec(() -> {
Stream<Query> newDefaultQueries = getConverter().createDefaultQueries(businessObject); BusinessObject businessObject = observeBusinessObjectSelected().getValue();
businessObject.getDefaultQueries().clear(); Stream<Query> newDefaultQueries = getConverter().createDefaultQueries(businessObject);
newDefaultQueries.forEach(businessObject.getDefaultQueries()::add); businessObject.getDefaultQueries().clear();
newDefaultQueries.forEach(businessObject.getDefaultQueries()::add);
});
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment